Skip to content

feat(dialog): experimental sharing dialog for the unified sharing API - #239

Merged
skjnldsv merged 11 commits into
mainfrom
feature/vite-lib-build
Aug 27, 2026
Merged

feat(dialog): experimental sharing dialog for the unified sharing API#239
skjnldsv merged 11 commits into
mainfrom
feature/vite-lib-build

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.90909% with 144 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.93%. Comparing base (b298105) to head (47b9e8b).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
lib/dialog/components/SharePanel.vue 67.03% 28 Missing and 2 partials ⚠️
lib/dialog/composables/useRecipientSearch.ts 21.87% 20 Missing and 5 partials ⚠️
lib/dialog/composables/useLinkShare.ts 51.35% 15 Missing and 3 partials ⚠️
lib/dialog/utils/clipboard.ts 0.00% 15 Missing and 2 partials ⚠️
lib/dialog/composables/useShareProperties.ts 36.00% 13 Missing and 3 partials ⚠️
lib/dialog/components/ShareConfirmation.vue 55.55% 10 Missing and 2 partials ⚠️
lib/dialog/api/share.ts 83.33% 9 Missing ⚠️
lib/dialog/utils/api.ts 75.86% 3 Missing and 4 partials ⚠️
lib/dialog/components/PropertyField.vue 93.33% 5 Missing ⚠️
lib/dialog/composables/usePermissionPresets.ts 87.80% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #239       +/-   ##
===========================================
- Coverage   95.77%   73.93%   -21.84%     
===========================================
  Files           4       23       +19     
  Lines          71      564      +493     
  Branches       25      168      +143     
===========================================
+ Hits           68      417      +349     
- Misses          3      126      +123     
- Partials        0       21       +21     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@skjnldsv skjnldsv self-assigned this Jul 22, 2026
@skjnldsv skjnldsv added the 2. developing Work in progress label Jul 22, 2026
Comment thread README.md
Comment thread lib/dialog/utils/logger.ts
Comment thread lib/dialog/index.ts Outdated
Comment thread lib/dialog/constants.ts
Comment thread lib/dialog/utils/api.ts Outdated
Comment thread lib/dialog/types/api.ts
Comment thread lib/dialog/components/InlineToggleField.vue Outdated
Comment thread lib/dialog/components/InlineToggleField.vue Outdated
Comment thread lib/dialog/SharingDialog.vue Outdated
Comment thread lib/dialog/SharingDialog.vue Outdated
Comment thread lib/dialog/SharingDialog.vue Outdated
Comment thread lib/dialog/components/SharePanel.vue Outdated
Comment thread lib/dialog/index.ts
Comment thread README.md
@skjnldsv
skjnldsv force-pushed the feature/vite-lib-build branch 2 times, most recently from d41a57b to 640c934 Compare July 23, 2026 20:50
Add the vite lib-mode build (multi-entry: index, public, ui and the
experimental dialog, with inlined CSS and generated type declarations),
the vitest configuration, the SVG `?raw` asset typings, and the
dependencies the dialog entry point relies on.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Add an experimental `@nextcloud/sharing/dialog` entry point targeting the
Nextcloud 35 unified sharing API:

- A Share class (obtained via createShare()/getShare()) wrapping the
  reactive share schema, with chainable mutation helpers and showDialog().
- SharingDialog + SharePanel: invite people or share via public link,
  permission presets with a custom fine-grained toggle view, and editable
  share properties with debounced persistence and native-validity errors.
- Per-type recipient rendering, property hint notes, a plain-language
  expiration/password summary and a folder upload hint; datetime-local
  expiration using the backend's full UTC support.

Callable unconditionally: it shows an error toast and no-ops when the
server does not provide the unified sharing API.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Cover the Share client and its mutation delegation, the property field
(rendering, debounced persistence, native validity, datetime), the inline
toggle field, recipient-to-model mapping, the outcome summary helper and
the share panel behavior (presets, permission toggles, recipient sync,
summary and folder-upload notes).

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Wire the Send button to the backend submit (activate the share, which
validates it and notifies mail recipients), then swap the form for a
confirmation view showing a success message, the share link in a
readonly copy field and, for public links, a QR code.

Also fixes token generation: crypto.randomUUID() is unavailable in
insecure contexts, so use the uuid package instead. The clipboard helper
moves to a shared util.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
SharePanel had grown to ~700 lines mixing several concerns. Extract them
so the component is thin glue and each concern is independently testable:

- utils/property.ts: isLongTextProperty, isOptionalProperty,
  defaultPropertyValue (pure).
- utils/link.ts: resolveShareLink and generateShareToken (shared with the
  confirmation view).
- composables: useShareProperties, usePermissionPresets, useRecipientSearch
  and useLinkShare hold the stateful logic.

SharePanel now uses defineModel for the active tab. Behaviour is
unchanged; adds unit tests for the new utils.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
The Clipboard API is unavailable on plain http, so copying fell through
to a window.prompt that never actually copied while the UI still showed
"Copied". Use a textarea + execCommand fallback there and throw on
failure so callers only report a successful copy.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
… switch

Disable the Send button until the share has at least one recipient, and
clear a stale submit error when switching between the invited and anyone
tabs.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
… icon

Render the QR behind a Show/Hide toggle instead of always, force it to a
dark-on-white card (with a quiet-zone margin) so it stays scannable in
dark mode, and use NcEmptyContent for the success state so the checkmark
reads as a proper large confirmation icon.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Put the confirmation copy button inside the link field via NcInputField's
trailing button. Use each field's native helperText for hints
(text/textarea/password/date and the boolean's description); keep the
custom note only for NcSelect, which has no helperText.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsv force-pushed the feature/vite-lib-build branch from 640c934 to a2f96e7 Compare August 26, 2026 14:13
@skjnldsv
skjnldsv marked this pull request as ready for review August 26, 2026 14:18
@skjnldsv skjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 26, 2026
Point @nextcloud/vue at the published ^9.10.0 (peer ^9.0.0) instead of a
local file link so the package installs in CI; the dialog degrades
gracefully on released nc-vue. Regenerate the lockfile after rebasing
onto main (eslint 10, vite 7, updated dev deps) and add sass-embedded,
which vite 7 requires for scss.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsv force-pushed the feature/vite-lib-build branch from a2f96e7 to 577ce1a Compare August 26, 2026 14:23
typedoc cannot resolve `.vue` single-file component imports and does not
need a full type check to extract API documentation (real type checking
runs as a separate step). Pass --skipErrorChecking so doc generation no
longer fails on the dialog's component imports.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsv force-pushed the feature/vite-lib-build branch from dec9efb to 47b9e8b Compare August 27, 2026 06:40
@skjnldsv
skjnldsv merged commit c10f63d into main Aug 27, 2026
12 of 14 checks passed
@skjnldsv
skjnldsv deleted the feature/vite-lib-build branch August 27, 2026 06:47
@skjnldsv skjnldsv mentioned this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants