Skip to content

feat(sidebar): mark the user's effective default dashboard with a star#130

Merged
rubenvdlinde merged 3 commits intodevelopmentfrom
feature/sidebar-default-star
May 5, 2026
Merged

feat(sidebar): mark the user's effective default dashboard with a star#130
rubenvdlinde merged 3 commits intodevelopmentfrom
feature/sidebar-default-star

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

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 a title tooltip.

Behaviour

The star marks the user's effective default — what they'd land on at /apps/mydash/ cold:

  1. defaultUuid (explicit pin)
  2. primary-group row with isDefault=1
  3. default-group row with isDefault=1
  4. first primary-group row
  5. first default-group row
  6. (personal dashboards intentionally excluded — silently starring an arbitrary personal dashboard the user never marked is more confusing than helpful)

What changed

  • DashboardSwitcherSidebar.vue — Star import + isDefaultDashboard() method + effectiveDefaultUuid computed mirroring the resolver. <span class="…__default-marker"> injected in all three section row templates with title + aria-label tooltip.
  • 9 new unit tests pinning the star-render and fallback contracts.

(Re-open of PR #127 after feat/*feature/* branch rename.)

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.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Quality Report — ConductionNL/mydash @ 7b69e84

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.

@rubenvdlinde rubenvdlinde merged commit d87fe2c into development May 5, 2026
49 checks passed
@rubenvdlinde rubenvdlinde deleted the feature/sidebar-default-star branch May 5, 2026 21:06
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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant