feat(sidebar): mark the user's effective default dashboard with a star#130
Merged
rubenvdlinde merged 3 commits intodevelopmentfrom May 5, 2026
Merged
feat(sidebar): mark the user's effective default dashboard with a star#130rubenvdlinde merged 3 commits intodevelopmentfrom
rubenvdlinde merged 3 commits intodevelopmentfrom
Conversation
The cog menu's "Set as default" entry already persists a per-user pin (`defaultDashboardUuid`), but the only feedback was the StarCheck icon inside the menu itself — which auto-closes after the click, so users never saw their pin take effect in the sidebar. The pinned row now carries an inline star icon (between the dashboard icon and the label) with a `title` tooltip explaining the pin. The star renders on whichever section the pinned dashboard lives in (personal, group, or default) so users see the affordance regardless of where their chosen default lives. No section restructuring or duplication — the dashboard stays in its home section, just with a visible default-marker.
The first cut only starred a row when the user had explicitly clicked "Set as default" — but most users never have to (the resolver picks a group default for them). Without a fallback, the star never appeared even though there *is* an effective default the user lands on. `effectiveDefaultUuid` mirrors the backend resolver's precedence (steps 0..5): pin → primary-group isDefault=1 → default-group isDefault=1 → first primary-group → first default-group. Step 6 (first personal dashboard) is intentionally excluded — silently starring an arbitrary personal dashboard the user never marked is more confusing than helpful. 5 new tests cover the fallback paths plus a regression check that an explicit pin still wins over any group fallback.
Contributor
Quality Report — ConductionNL/mydash @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| composer | ✅ | ✅ 100/100 | |||
| npm | ✅ | ✅ 501/501 | |||
| PHPUnit | ✅ | ||||
| Newman | ✅ | ||||
| Playwright | ⏭️ |
Coverage: 90.7% (127/140 statements)
Quality workflow — 2026-05-05 21:04 UTC
Download the full PDF report from the workflow artifacts.
4 tasks
rubenvdlinde
added a commit
that referenced
this pull request
May 6, 2026
…ixes First end-to-end run of `--project docs-capture` against the local Nextcloud instance. 6/15 tests pass cleanly; the rest hit selector misses on UI markup that drifted since the spec was authored. Failures are non-fatal (each test re-navigates from `/apps/mydash/`) so the run captures everything reachable up to the first miss in each flow. Captured: - user track: 13 PNGs (U1 first launch + U2 add button + create modal, U3 edit-mode + widget picker, U4 edit mode + drag + reflow, U7 default marker, U8 url bar, U9 after switch) - admin track: 3 PNGs (A2 templates list + create modal, A3 group cog) Spec changes: - `mode: 'default'` instead of serial — selector misses no longer cascade to abort the suite. - U2 create-dashboard form: hooked on placeholder text from `DashboardConfigModal.vue` (`"My dashboard"`, `"What is this dashboard for?"`) instead of the non-existent `name=` attributes. - `playwright.config.ts`: per-project `testIgnore` so the chromium regression project skips the capture spec while the docs-capture project picks it up. The previous root-level ignore was shadowing the project's testMatch. Remaining selector misses live in the spec for follow-up: - U3 picker → form → added (the `Text` button selector misses its actual NcActions label) - U4 resize handle (`.ui-resizable-handle.ui-resizable-se` doesn't match the actual GridStack drag-handle class) - U5/U6 context menu (`.widget-context-menu` vs the actual class) - U7 fallback marker (depends on PR #130 deployment) - U8 deep-link landing (depends on PR #131 deployment) - U10 dashboard-config modal selector - A1 / A4 / A5 admin pages — most need an admin nav probe Each remaining failure dropped a `test-results/<test>/test-failed-1.png` that shows the page state at the moment of failure — those are useful debugging starting points.
rubenvdlinde
added a commit
that referenced
this pull request
May 6, 2026
Selector misses on the first capture-spec run came from depending on visible label text (which i18n shifts), CSS classes (refactor magnets), and aria-labels that map to multiple elements. Switched the high-traffic selectors to `data-testid` so the spec survives copy edits, class renames, and Vue refactors. Twelve new test ids: - `DashboardConfigModal.vue` — dashboard-name-input, dashboard-description-input, dashboard-save-button, dashboard-delete-button - `DashboardRowActions.vue` — cog-edit-dashboard, cog-dashboard-config, cog-add-widget, cog-set-default, cog-delete - `WidgetContextMenu.vue` — widget-context-menu (container), ctx-edit, ctx-remove, ctx-cancel - `AddWidgetModal.vue` — add-widget-save The `data-testid` attributes are inert in production renders (no behaviour, no styling) and don't change any user-facing markup. Specs target them via `[data-testid="…"]` selectors. Updated `tests/e2e/docs-screenshots.spec.ts` (U2, U3, U5, U6, U7, U10) to use the new ids. The remaining failure modes are env-specific (PR #130/#131 deployment for the ★ marker and deep-link landing) rather than selector brittleness. Note: the live env serves the previously-built bundle, so reshooting requires `npm run build` (or removing `js/mydash-main.js` so the playwright globalSetup auto-rebuilds) before `npx playwright test --project docs-capture`.
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
The cog menu's "Set as default" entry persisted a per-user pin (
defaultDashboardUuid) but the only feedback was the StarCheck icon inside the menu — which auto-closes after click, so users never saw their pin take effect. The pinned row now carries an inline star icon (between the dashboard icon and the label) with atitletooltip.Behaviour
The star marks the user's effective default — what they'd land on at
/apps/mydash/cold:defaultUuid(explicit pin)isDefault=1isDefault=1What changed
DashboardSwitcherSidebar.vue— Star import +isDefaultDashboard()method +effectiveDefaultUuidcomputed mirroring the resolver.<span class="…__default-marker">injected in all three section row templates with title + aria-label tooltip.(Re-open of PR #127 after
feat/*→feature/*branch rename.)