Skip to content

feat(sidebar): mark the pinned default dashboard with a star#127

Closed
rubenvdlinde wants to merge 2 commits intodevelopmentfrom
feat/sidebar-default-star
Closed

feat(sidebar): mark the pinned default dashboard with a star#127
rubenvdlinde wants to merge 2 commits intodevelopmentfrom
feat/sidebar-default-star

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Summary

When a user clicks Set as default in a dashboard's cog menu, the pin (defaultDashboardUuid) is saved server-side, but the menu auto-closes immediately so the only feedback (the StarCheck icon inside the menu) is gone before the user notices it. The sidebar itself shows nothing.

This PR makes the pin visible in the sidebar:

  • A small star icon renders between the dashboard icon and the label on whichever row matches defaultUuid.
  • The star carries a title tooltip explaining what the pin means ("Default dashboard — opens automatically when you visit MyDash").
  • An aria-label on the same span so screen readers announce the marker.
  • Works in all three sections — personal, primary-group, and default-group — so the marker follows wherever the user pinned.

No section restructuring and no duplication: the dashboard keeps its home section, just with an extra visible affordance.

What changed

  • src/components/Workspace/DashboardSwitcherSidebar.vue:

    • Star import + registration
    • isDefaultDashboard(dashboard) method
    • <span class="dashboard-switcher-sidebar__default-marker"> injected in all three section row templates, gated on isDefaultDashboard(dashboard)
    • Scoped style for the marker (uses --color-warning so it inherits theme overrides)
  • src/components/Workspace/__tests__/DashboardSwitcherSidebar.spec.js: four new cases pinning the contract — star renders only on the matching row, carries the title + aria-label, hidden when defaultUuid is empty, and works on a group-section row when the user pinned a shared dashboard.

Test plan

  • vitest run — 850 / 850 (was 846, +4 new)
  • eslint clean on touched files
  • Manual UI: open the sidebar, click "Set as default" on a personal dashboard via the cog menu, confirm the star appears immediately on that row
  • Manual UI: hover the star, confirm the tooltip
  • Manual UI: click "Default dashboard" again to clear the pin, confirm the star disappears

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

github-actions Bot commented May 5, 2026

Quality Report — ConductionNL/mydash @ 2269d8e

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 15:33 UTC

Download the full PDF report from the workflow artifacts.

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 @ 376bb88

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 15:39 UTC

Download the full PDF report from the workflow artifacts.

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