Skip to content

feat: open the dashboard that fits the time of day and device - #48

Merged
AmrMsCLL merged 1 commit into
mainfrom
feat/dashboard-context
Oct 5, 2026
Merged

AmrMsCLL merged 1 commit into
mainfrom
feat/dashboard-context

Conversation

@AmrMsCLL

@AmrMsCLL AmrMsCLL commented Oct 5, 2026

Copy link
Copy Markdown
Member

Stacked on #47. This is 11e of as2026-10-05-strata-phase-11-next-batch-2.md.

What changes

  • While editing a dashboard, "Opens by itself" sets a time range and a device: any device, phones or computers. A range can cross midnight, for example 22:00 to 06:00.
  • Home opens the first dashboard whose time and device match. Dashboards with conditions win over plain ones, and the first dashboard is the fallback. Phones are screens narrower than 768px, the same breakpoint as the tab bar.
  • Choosing a dashboard by hand is remembered for the rest of the visit in sessionStorage. If storage is unavailable, Home falls back to the automatic choice.
  • Saving sends the schedule only when it changed.

Migration

20261005120000_dashboard_context:

ALTER TABLE "dashboards" ADD COLUMN "show_from" INTEGER,
ADD COLUMN "show_until" INTEGER,
ADD COLUMN "show_on" TEXT NOT NULL DEFAULT 'any';

Contract

  • Dashboards gain showFrom and showUntil (minutes after midnight, or null) and showOn (any, phone or desktop). PATCH /me/dashboards/:id accepts all three; the two times must be set together and must differ.

Verification

  • Server integration: test/integration/dashboards.spec.ts (2 passed).
  • Frontend: test/dashboard.spec.tsx (7 passed). It covers the picker, including a range crossing midnight, and the edit flow.
  • Lint and build pass.

@github-actions github-actions Bot added the size/l 201-600 changed lines, excluding lockfiles label Oct 5, 2026
@AmrMsCLL
AmrMsCLL force-pushed the feat/tidy-file-types branch from de4e1b5 to 1052d34 Compare October 5, 2026 19:05
Base automatically changed from feat/tidy-file-types to main October 5, 2026 19:05
@AmrMsCLL
AmrMsCLL force-pushed the feat/dashboard-context branch from e7453d3 to ea9f43a Compare October 5, 2026 19:05
@AmrMsCLL
AmrMsCLL merged commit fc8e964 into main Oct 5, 2026
6 checks passed
@AmrMsCLL
AmrMsCLL deleted the feat/dashboard-context branch October 5, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l 201-600 changed lines, excluding lockfiles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant