From 18115482072bdce69bcb54a7f8239f4c0f18f21f Mon Sep 17 00:00:00 2001 From: Frederic Cabassut Date: Mon, 9 Mar 2026 11:59:37 +0100 Subject: [PATCH] feat: add sharing UI components and integrate into NoteCard/NoteEditor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create ShareDialog with user search autocomplete, collaborator list, and remove - Create CollaboratorPopover for hover/click indicator on shared notes - Add collaborator indicator to NoteCard (always visible Users icon) - Replace trash with Leave action for non-owner shared notes - Add share button to NoteEditor toolbar (UserPlus → Users when shared) Co-Authored-By: Claude Opus 4.6 --- src/lib/components/CollaboratorPopover.svelte | 68 +++++++ src/lib/components/NoteCard.svelte | 60 ++++-- src/lib/components/NoteEditor.svelte | 66 +++++- src/lib/components/ShareDialog.svelte | 191 ++++++++++++++++++ 4 files changed, 365 insertions(+), 20 deletions(-) create mode 100644 src/lib/components/CollaboratorPopover.svelte create mode 100644 src/lib/components/ShareDialog.svelte diff --git a/src/lib/components/CollaboratorPopover.svelte b/src/lib/components/CollaboratorPopover.svelte new file mode 100644 index 0000000..07ef66d --- /dev/null +++ b/src/lib/components/CollaboratorPopover.svelte @@ -0,0 +1,68 @@ + + + +
+ + + {#if showPopover} +
+

Shared with

+
    + {#if ownerName} +
  • + {ownerName} (Owner) +
  • + {/if} + {#each collaborators as collab} +
  • + {collab.displayName || collab.email} +
  • + {/each} +
+
+ {/if} +
diff --git a/src/lib/components/NoteCard.svelte b/src/lib/components/NoteCard.svelte index 3ef6527..dab4a7b 100644 --- a/src/lib/components/NoteCard.svelte +++ b/src/lib/components/NoteCard.svelte @@ -1,15 +1,17 @@ + + +
+ +
e.stopPropagation()} + onkeydown={(e) => e.stopPropagation()} + data-testid="share-dialog" + > + +
+

Share note

+ +
+ + +
+
+ + +
+ + + {#if searchResults.length > 0} +
    + {#each searchResults as user} +
  • + +
  • + {/each} +
+ {/if} +
+ + +
+

People with access

+
    + +
  • + + {ownerName} + (Owner) + +
  • + + {#each collaborators as collab} +
  • + + {collab.displayName || collab.email} + + +
  • + {/each} +
+
+
+