Skip to content

feat: typed indicator dots in sidebar mini-calendar on calendar tab - #300

Merged
h4yfans merged 5 commits into
mainfrom
bold-moser-c6dba9
Apr 21, 2026
Merged

feat: typed indicator dots in sidebar mini-calendar on calendar tab#300
h4yfans merged 5 commits into
mainfrom
bold-moser-c6dba9

Conversation

@h4yfans

@h4yfans h4yfans commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Calendar tab sidebar mini-calendar now shows up to 3 typed dots per day (one dot per item, colored by visualType) instead of the shared journal-style intensity dot. Days with many items prioritize diversity — one dot per unique type first, then fill remaining slots with duplicates.

Example: a day with 3 events + 2 tasks + 1 snooze renders one purple + one blue + one orange dot, not three purple.

Journal tab unchanged — still shows the single emerald/amber intensity dot, so the two tabs now give visibly different information through the sidebar.

Files changed (6)

  • apps/desktop/src/renderer/src/components/calendar/visual-type-meta.ts — new dotColor field per visualType (5 saturated hex values)
  • apps/desktop/src/renderer/src/components/calendar/day-dots.ts (new) — pure helper buildDayDots() with rank-based sort that achieves diversity-then-fill in one declarative pass
  • apps/desktop/src/renderer/src/components/calendar/day-dots.test.ts (new) — 8 unit tests, BDD style
  • apps/desktop/src/renderer/src/components/tasks/date-picker-calendar.tsx — new optional dayDots prop + JSX fork (inline backgroundColor bypasses Tailwind JIT for data-driven hexes)
  • apps/desktop/src/renderer/src/components/day-panel/global-day-panel.tsx — wires buildDayDots(eventItems) for calendar mode; preserves activityData path for journal mode
  • CHANGELOG.md — new 2026-04-21 entry

Test coverage

# Scenario Outcome
1 Empty input {}
2 1 event 1 purple dot
3 2 tasks + 1 event [event, task, task] (diversity + fill)
4 5 unique-type items, cap-at-3 first 3 by canonical order
5 3 events + 2 tasks + 1 snooze [event, task, snooze] (pure diversity)
6 5 tasks only [task, task, task] (pure fill)
7 Items across UTC midnight buckets by local date
8 Items on distinct days independent buckets

Verification

  • pnpm vitest run day-dots.test.ts8/8 pass (4ms)
  • pnpm typecheck:node, pnpm typecheck:web — clean
  • pnpm lint — 0 errors on modified files (913 pre-existing warnings in untouched files: tasks.tsx, template-editor.tsx, templates.tsx, yjs-ipc-provider.ts)

Test plan

  • pnpm dev — visually confirm the Calendar tab sidebar shows typed dots
  • Seed a day with 3 events + 2 tasks + 1 snooze; verify one purple + one blue + one orange
  • Switch to Journal tab; verify intensity-dot rendering is unchanged
  • Click a day cell while on Calendar tab; verify calendar view anchors in-place (pre-existing behavior, untouched)
  • Confirm reminder color #EC4899 reads acceptably against the sidebar (flagged for design review below)

Scope notes

Left uncommitted in the worktree (unrelated to this feature, noise from a prior session, 3700 lines of pure Prettier reformatting):

  • apps/desktop/src/main/ipc/generated-ipc-invoke-map.ts
  • apps/desktop/src/preload/generated-rpc.ts

These look like regen output that was never committed. They need a separate decision (commit or reset).

Decisions flagged for review:

  1. Reminder dot color = #EC4899 — the existing chip text #FCCEE8 is too pale for a white sidebar. If design prefers a different saturated pink (e.g., #F43F5E rose-500), it's a one-hex change in visual-type-meta.ts.

  2. Diversity-vs-density for >3-item days — current behavior is one dot per unique type first, then fill. Alternative would be first-3 items by canonical order (density). This is reversible in 2 lines of buildDayDots.

Ship-skill gates tailored for scope. Full specialist army / adversarial Codex / plan verification / eval suites were skipped — diff is 50 lines of real code with no SQL, auth, migrations, LLM trust boundary, or data-destruction surface. Gates kept: fresh unit tests, typecheck, lint, self-reviewed diff.

h4yfans added 5 commits April 21, 2026 03:36
When viewing the Calendar tab, the right-sidebar mini-calendar now renders
up to 3 colored dots per day — one dot per item, colored by visualType —
instead of the single activity-intensity dot it shared with Journal mode.

Days with more items than slots prioritize diversity: one dot per unique
type first, then filling remaining slots with duplicates. Example: a day
with 3 events + 2 tasks + 1 snooze renders as purple + blue + orange
(one of each type) rather than three purple dots.

Journal tab unchanged — still shows the single emerald/amber intensity
dot, so switching tabs visibly changes what the sidebar is telling you.

Implementation:
- visual-type-meta.ts: new dotColor field on each of 5 types (saturated
  hex values; reminder gets #EC4899 since chip text #FCCEE8 is too pale
  for a white sidebar)
- day-dots.ts: pure helper buildDayDots(items) with rank-based sort
  achieving diversity-then-fill in a single declarative pass
- day-dots.test.ts: 8 unit tests (empty, single, ordering, cap-at-3,
  diversity-vs-density, duplicate-fill, local-date bucketing, multi-day)
- date-picker-calendar.tsx: new optional dayDots prop; JSX fork renders
  inline-flex dot strip when present, falls back to existing activityData
  path otherwise. Inline backgroundColor bypasses Tailwind JIT
- global-day-panel.tsx: replaces eventActivityData memo with
  dayDotsData = useMemo(() => buildDayDots(eventItems))

Verification: 8/8 vitest tests pass (4ms), typecheck:node + typecheck:web
clean, ESLint clean on modified files.
…mponents

This update refines the visual representation of calendar items by centralizing color management through the EVENT_TYPE_COLORS utility. Key changes include:

- Replaced hardcoded color values in CalendarItemChip, CalendarYearView, and visual-type-meta.ts with dynamic color assignments from EVENT_TYPE_COLORS.
- Streamlined the CalendarItemChip component to utilize useMemo for chip styling, improving performance.
- Updated the journal-day-panel to leverage the new color utility for event representation.

These changes improve maintainability and consistency in visual styles across the calendar components.
Calendar event chips show a per-type icon before the title via a typed
VISUAL_TYPE_ICONS table: reminder=AlarmClock, task=CheckSquare3,
snooze=NotificationSnooze, event=Calendar03, external_event=Calendar01.

Sidebar Tasks/All-Tasks tab remapped at the 'list-checks' key to render
CheckmarkSquare03Icon (backward-compatible with stored user tab data).
Inbox triage snooze picker header swaps Clock for NotificationSnooze.

Adds CheckSquare3 and NotificationSnooze exports to icon-map.
This commit enhances the CalendarItemChip component by introducing a base color for selected items and refining the styling logic. Key changes include:

- Added `getEventBaseColor` to manage background color for selected chips.
- Updated the chip styling logic to differentiate between selected and non-selected states.
- Improved hover effects for better user interaction feedback.

These adjustments improve the visual consistency and user experience of calendar items.
@h4yfans
h4yfans merged commit 278badc into main Apr 21, 2026
7 checks passed
@h4yfans
h4yfans deleted the bold-moser-c6dba9 branch May 6, 2026 16:36
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