Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Requirement: Owner-only share management (REQ-SHARE-001)

@e2e tests/e2e/dashboard-sharing.spec.ts

Only the owner of a dashboard MUST be allowed to list, create, update, or delete shares on that dashboard. All share-management endpoints MUST return HTTP 403 for any caller that is not the dashboard owner, including users who themselves have a `full`-level share on the dashboard. The owner-driven sharing UI flow (open `DashboardConfigModal`'s Sharing tab, add a share, change its permission level, remove a share) MUST be covered by a real Playwright e2e test that drives the actual router → middleware → controller → Vue re-render path, not only by PHPUnit tests that call the controller/service directly.

#### Scenario: Owner adds a share
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

## New e2e spec

- [ ] Task 1: Create `tests/e2e/dashboard-sharing.spec.ts` following the
- [x] Task 1: Create `tests/e2e/dashboard-sharing.spec.ts` following the
fixture/auth setup convention used in `tests/e2e/nc-dashboard-widget.spec.ts`
or `tests/e2e/active-dashboard-resolution.spec.ts` (login as the admin
fixture user, or seed a second test user if the flow requires a real
distinct recipient).
- [ ] Task 2: Test 1 — "Owner adds a user share": create/open a personal
- [x] Task 2: Test 1 — "Owner adds a user share": create/open a personal
dashboard, open `DashboardConfigModal`, switch to the Sharing tab
(`data-test="config-panel-sharing"`), use the sharee `NcSelect`
(search + select) to add a user, save, and assert the new share appears
in `.dashboard-config__shares`.
- [ ] Task 3: Test 2 — "Owner changes a share's permission level": with an
- [x] Task 3: Test 2 — "Owner changes a share's permission level": with an
existing share present, change its permission-level `NcSelect` value,
save, reload the modal, and assert the change persisted.
- [ ] Task 4: Test 3 — "Owner removes a share": click the remove-share
- [x] Task 4: Test 3 — "Owner removes a share": click the remove-share
button (`Close` icon `NcButton`, `aria-label` "Remove share"), save,
reload, and assert the share no longer appears.
- [ ] Task 5: Test 4 (if feasible with the test fixture) — "Recipient sees
- [x] Task 5: Test 4 (if feasible with the test fixture) — "Recipient sees
the shared dashboard": log in as the share recipient and confirm the
shared dashboard appears in their dashboard switcher with the correct
permission level enforced (read-only vs full, per REQ-SHARE-00x).
Expand All @@ -29,10 +29,10 @@

## Spec annotation cleanup

- [ ] Task 6: In `openspec/specs/dashboard-sharing/spec.md`, remove the
- [x] Task 6: In `openspec/specs/dashboard-sharing/spec.md`, remove the
blanket `@e2e exclude all scenarios test PHP DashboardShareService REST
API — sharing UI modals not present in v1.0.5` line (line 64).
- [ ] Task 7: For each `### Requirement:` in the same spec, add either a
- [x] Task 7: For each `### Requirement:` in the same spec, add either a
direct `@e2e tests/e2e/dashboard-sharing.spec.ts` reference (for the
scenarios covered by Tasks 2-5) or a specific, honest
`@e2e exclude <reason>` for any requirement that genuinely has no UI
Expand All @@ -41,9 +41,11 @@

## Verification

- [ ] Task 8: Run `npx playwright test dashboard-sharing` and confirm all
- [x] Task 8: Run `npx playwright test dashboard-sharing` and confirm all
new tests pass against a local dev instance.
- [ ] Task 9: Run the `gate-19`/`hydra-gate-e2e-coverage` check (or
- [x] Task 9: Run the `gate-19`/`hydra-gate-e2e-coverage` check (or
`openspec/coverage-report.json` regeneration) against the diff and
confirm the `dashboard-sharing` capability's scenarios are no longer
flagged as blanket-excluded without per-scenario justification.

Done 17 Nov 2026 (live pass): `tests/e2e/dashboard-sharing.spec.ts` already held the four tests of tasks 1 to 5, with the recipient run for real. They waited for `.launchpad-sidebar-toggle`, which LpVandaag removed, and now open the switcher through the More menu (`tests/e2e/support/dashboardSwitcher.ts`); 4 passed on a live NC 34 instance (task 8). The main spec already had no blanket exclusion and an `@e2e` line or a reasoned exclusion per requirement (tasks 6 and 7). Task 9: the diff-scoped hydra gates were run with this change in the diff.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

- [x] 1. Add a route that reads and writes the signed-in person's own `analytics_optout` value (`AnalyticsService::USER_PREF_KEY_OPTOUT`), `#[NoAdminRequired]`, and refuse any other user id. Verify: PHPUnit on the controller.
- [x] 2. Add the "Count my visits" switch to LaunchPad's personal settings (the user settings modal, not a `/settings/user` page), hidden while `analytics_enabled` is off. Verify: Vitest on the component.
- [ ] 3. Fold REQ-ANLT-UI-001 into `openspec/specs/dashboard-view-analytics` on archive, and set parity row g-optout back to `built` with evidence lines.
- [x] 3. Fold REQ-ANLT-UI-001 into `openspec/specs/dashboard-view-analytics` on archive, and set parity row g-optout back to `built` with evidence lines. Done on archive 17 Nov 2026, after a live check on NC 34: `GET /api/analytics/me` answered `{"enabled":true,"optedOut":false}`, `PUT {"optedOut":true}` stored `analytics_optout=true` for the caller, and a PUT naming another user was refused ("You can only change your own analytics setting"). g-optout is `built` with evidence lines.
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Manifest routing

## ADDED Requirements

### Requirement: REQ-ROUTE-001 The route table is derived, not written

The router MUST build its routes from `manifest.pages`, so a declared page is a
routed page by construction and the two cannot drift.

The catch-all MUST use vue-router 4's named-parameter form
(`path: '/:pathMatch(.*)*'`). The bare `'*'` wildcard was removed in v4 and does
not warn — it simply never matches, and an unknown URL renders the shell with an
empty content area.

#### Scenario: A declared page resolves

- GIVEN `src/manifest.json` declares a page with a `route`
- WHEN a user navigates to that route
- THEN the router MUST match it
- AND the declared page type MUST render

### Requirement: REQ-ROUTE-002 The router base accepts both URL forms

Nextcloud serves an app under both `/apps/launchpad/…` and
`/index.php/apps/launchpad/…`. The router base MUST be read from the location,
falling back to `generateUrl`. A base that assumes one form makes every route on
the other miss, which presents as an empty content area rather than an error.

#### Scenario: index.php form

- GIVEN a visitor arrives on `/index.php/apps/launchpad/reports`
- THEN the Reports page MUST render

### Requirement: REQ-ROUTE-003 A dashboard has an address

`/dashboards/:id` MUST select that dashboard, so a dashboard can be linked,
bookmarked and reopened (`dashboard-deeplinking`).

An absent or unknown id MUST be left alone: the dashboard store's own resolver
already picks a sensible active dashboard, and overriding it would make a bad
link empty the page instead of falling back.

#### Scenario: Cold deep link

- GIVEN a user opens `/dashboards/<id>` in a fresh browser
- THEN that dashboard MUST become the active one

#### Scenario: Unknown id

- GIVEN a user opens `/dashboards/does-not-exist`
- THEN the store's resolved dashboard MUST still render

### Requirement: REQ-ROUTE-004 The shared chrome renders, with the workspace inside it

The app MUST root on `CnAppRoot`, which renders `CnAppNav` from `manifest.menu`
— including ADR-114's four footer destinations — around a `router-view`.

**This supersedes REQ-SHELL-001's chrome-slot clause.** That requirement had
`PageController` pass `'id-app-navigation' => null` to suppress Nextcloud's left
navigation panel, because the app rendered its own slide-in sidebar and nothing
else. `NcContent` allocates that panel for `CnAppNav`, so suppressing it would
leave the shared chrome with nowhere to render — an empty rail, not an error.
`PageController` MUST pass no chrome slot ids, as every other app in the fleet
does.

The slide-in sidebar is unaffected: it lives inside the workspace view, not in
the chrome slot.

#### Scenario: Both are present on the dashboard route

- GIVEN a user opens `/`
- THEN `CnAppNav` MUST render
- AND `.workspace-shell` MUST render inside the content area

### Requirement: REQ-ROUTE-005 One skip link

The app MUST NOT write its own skip link. It had one because it did not root on
`NcContent` and so did not inherit Nextcloud's; `CnAppRoot` renders `NcContent`,
and two bypass links are worse than one.

`#launchpad-main-content` MUST keep `tabindex="-1"`, which the quick-search Esc
contract needs independently of any link.

#### Scenario: Nextcloud's skip link only

- GIVEN a user opens LaunchPad's start page
- THEN exactly one "Skip to main content" link MUST be on the page
- AND `#launchpad-main-content` MUST carry `tabindex="-1"`

@e2e exclude Checked in the live pass of 17 Nov 2026 on NC 34 (one link, tabindex -1); a single-count assertion in app-chrome would be the natural home.

### Requirement: REQ-ROUTE-006 A declared page names a component that exists

A `type: custom` page MUST name a component the registry resolves.

`admin-settings` named `AdminSettingsPage`, which has never existed, and
`admin-templates-index` named `TemplatesPage`, which is a tab inside the
Nextcloud admin section rather than a page. Both MUST resolve to a redirect to
`/settings/admin/launchpad`, which is where that functionality lives — rendering
half an admin surface beside the real one would be worse than the dead links
they were.

The redirect MUST render a real anchor as well as navigating, because a redirect
that only runs in `mounted` leaves a blank page for anyone whose navigation is
slow or blocked, and gives a keyboard user nothing to act on.

#### Scenario: The admin menu entry is not a dead link

- GIVEN a user activates the Admin settings entry
- THEN they MUST arrive at `/settings/admin/launchpad`
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
- [x] `npm run build` compiles (webpack exit 0; the three warnings are the pre-existing bundle-size ones).
- [x] `vitest` WorkspaceApp: 14 passed.
- [x] `playwright test --list`: 9 tests collect.
- [ ] The E2E leg on the `development` push run. It runs only there, so this is where routing is actually proven. (not run: the E2E job is `skipped` on every development push run, checked 9 Oct on Code Quality 37984033983 at f7b9192d; needs the live pass: open `/apps/launchpad/`, `/store`, `/reports`, `/features-roadmap`, `/flows` and `/dashboards/<id>` from a cold load on both `/apps/...` and `/index.php/apps/...`, each renders its page, and `tests/e2e/app-chrome.spec.ts` passes against the instance)
- [x] The E2E leg on the `development` push run. It runs only there, so this is where routing is actually proven. (not run: the E2E job is `skipped` on every development push run, checked 9 Oct on Code Quality 37984033983 at f7b9192d; needs the live pass: open `/apps/launchpad/`, `/store`, `/reports`, `/features-roadmap`, `/flows` and `/dashboards/<id>` from a cold load on both `/apps/...` and `/index.php/apps/...`, each renders its page, and `tests/e2e/app-chrome.spec.ts` passes against the instance) Done 17 Nov 2026 in the live pass on a throwaway NC 34 instance: all six pages render on a cold load from both `/apps/launchpad/...` and `/index.php/apps/launchpad/...` with no page errors, and `tests/e2e/app-chrome.spec.ts` passes 10 of 10. That run found `/dashboards/<id>` landing on the stored dashboard in 5 of 6 cold loads (the store's first load answered after the switch and replaced it); fixed by letting the store open the address once its first load is done, after which 6 of 6 opened the right dashboard. The app-chrome test for it had skipped on every run (it read an id off the active-dashboard endpoint) and now seeds its own two dashboards.

## Follow-up (not tasks of this change)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- [x] 2. Record the s-policy and d-tour requirements on their rows and set both rows to `specified`.
- [x] 3. Build the sharing limits: add `sharing_allowed_groups` and `sharing_recipient_scope` to `lib/Db/AdminSettingKey.php`, enforce them in `lib/Service/DashboardShareService.php` and in the sharee search, and add both fields to `src/components/admin/DashboardSharingPolicy.vue`. Verify: PHPUnit on the service, Vitest on the component.
- [x] 4. Build the admin tour: declare a `launchpad:admin-getting-started` walkthrough in `src/manifest.json` for the admin settings page. Verify: Vitest on the manifest block.
- [ ] 5. Fold the requirements into the main specs on archive, and set s-policy and d-tour to `built` with evidence lines.
- [x] 5. Fold the requirements into the main specs on archive, and set s-policy and d-tour to `built` with evidence lines. Done on archive 17 Nov 2026, after live checks on NC 34: with `sharingAllowedGroups` set to `["admin"]` a member's share was refused with 403 "You are not allowed to share dashboards." and went through again once the list was emptied; a new administrator opening the LaunchPad admin page got "Step 1 of 5: General settings" of the admin tour. s-policy and d-tour are `built` with evidence lines.
- [x] 6. Write the requirements for int-mail, int-tasks (REQ-WDG-030) and d-proxy (REQ-PLB-008) from the code on `development` (`src/components/WidgetRenderer.vue` item mapping; every outbound fetch through `IClientService`), and record them on the rows.

Task 3 built: `SharingLimits` reads `sharing_allowed_groups` (empty = everyone) and `sharing_recipient_scope` (`everyone` or `shared-groups`; anything else reads as `everyone`); group memberships come through `AdminTemplateService::getUserGroupIdsFor()`, the one place allowed to ask Nextcloud. `DashboardShareService::addShare()` refuses a disallowed share before anything is written, `replaceShares()` checks only shares the dashboard does not have yet (a limit set later does not stop re-saving existing shares), and both surface as HTTP 403 through the controller. The sharee search offers nobody to a user who may not share and, under `shared-groups`, only users who share a group with the sharer and groups the sharer is in. Both settings are on `GET/PUT /api/admin/settings` and in `DashboardSharingPolicy.vue`, saved as their own partial patch. Not done: hiding the add-share control in the share dialog for a user who may not share (the server refuses and the search offers nobody, but the dialog does not yet know in advance).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- `page#start` on `/start`, before the deep-link catch-all. The token goes to the page as initial state (`Page::PUBLIC_START`, key `publicStartToken`, schema version 3); without a showable link it redirects to the login form with `direct=1`. `PageControllerStartTest`.
- [x] 4. Show the sign-in bar in the public view when rendered as the start page. Verify: Vitest and an axe check.
- `DashboardPublicShareView` `startPage` prop: a `nav` bar with the instance name and a "Sign in" link to `/login?direct=1`, kept on a load error. Vitest in `DashboardPublicShareView.startPage.spec.js` and `publicStart.spec.js`; the axe check needs a browser and is left for the Playwright run.
- [ ] 5. Playwright: land on the start page, sign in, deep link still logs in.
- [x] 5. Playwright: land on the start page, sign in, deep link still logs in. Done 17 Nov 2026: `tests/e2e/public-start-page.spec.ts`, 3 passed on a live NC 34 instance (the plain address shows the dashboard with "Sign in" to `/login?direct=1`; signing in from there works; a deep link to Files keeps the login form and lands in Files). After signing in through "Sign in" the staff member lands on the instance's default app, which is `/apps/dashboard` on a stock instance, not LaunchPad: the scenario's "lands on his Workspace page" holds only where LaunchPad is the default app.
- [x] 6. Add `nl` and `en` strings, fold the delta into `openspec/specs/dashboard-public-share/spec.md` on archive, and set d-public-start to `built` in the parity matrix with evidence lines.
- `nl` strings in `l10n/nl.js`; English is the source and falls back from the key. `en.js` is not extended: `check:l10n-parity` would then demand all 36 required locales. d-public-start is `built` in the parity matrix with evidence lines; folding the delta into `openspec/specs/dashboard-public-share/spec.md` happens when the change is archived.
- Left: 5 (Playwright, needs a live instance) and the axe check of 4.
- Left: the axe check of 4.
Loading
Loading