feat(sharing): per-note Share button, dialog, and visibility menu#762
Merged
Conversation
f0c220c to
362f5e7
Compare
- types/electron.ts: ShareVisibility, ShareSettings, NoteShareInvitation.
- utils/personalEmailDomains.ts: gmail/outlook/yahoo etc. — used by the
share dialog to hide the 'Everyone at {domain}' option when the
owner's email belongs to a personal-email provider.
- stores/noteStore.ts: per-cloud-id share cache (settings + invitations
+ raw token kept in-memory for the active dialog session).
- services/NoteSharingService.ts: wraps cloudApi for share state,
visibility/domain updates, token rotation, and invitations CRUD.
- NoteEditor: subtle Share icon button left of the Download button.
Tints blue when the note has any non-private visibility.
- ShareNoteDialog: Notion/Granola-style share UI with email invite,
optimistic visibility toggle, copy-link, member list with resend +
revoke actions, and read-only fallback when the viewer isn't owner.
- ShareVisibilityMenu: dropdown for invited / link / domain. Hides the
'Everyone at {domain}' option when the owner's domain is a personal
provider. Stores last-used visibility in user-scoped localStorage so
reopening pre-selects the previous choice; first-ever open uses the
safer 'invited' default.
Adds button, dialog title/labels/actions, visibility option strings
(with {{domain}} interpolation), error messages, and pending/accepted
member states for the share dialog in en/de/es/fr/it/ja/pt/ru/zh-CN/
zh-TW.
The Share button only renders for synced notes (cloud_id present), so the dialog's not-yet-synced branch is unreachable. Replace it with a type-narrowing early return and remove the dead key across all locales.
362f5e7 to
2c51068
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Desktop UI for the Note Sharing feature (paired with
OpenWhispr/openwhispr-api#63).NoteEditorheader, immediately left of the Download button — icon picks up a subtle blue accent when the note isn't privateShareNoteDialog(Radix-based): visibility selector with three options (Anyone with the link,Everyone at {domain} with the link,Only people invited), email-input invite flow, owner row, pending invitation rows with Resend/Revokeinvited(safer)noteEditor.share.*across all 10 localesFiles
ShareNoteDialog.tsx,ShareVisibilityMenu.tsx,NoteSharingService.ts,personalEmailDomains.tsNoteEditor.tsx(Share button + dialog mount),noteStore.ts(shareByCloudIdcache),electron.ts(ShareVisibility,ShareSettings,NoteShareInvitation), all 10translation.jsonStates covered
Esccloses;Cmd+Enterfrom email input submits inviteTest plan
invitedon first ever openlink→ click Copy link → button shows "Copied" then revertsdomain→ confirm domain auto-derived from owner email; not visible for personal-email owners