Skip to content

Promote domains + priority UI on task rows (#162)#165

Open
meninoebom wants to merge 2 commits into
feature/priority-backendfrom
feature/priority-ui
Open

Promote domains + priority UI on task rows (#162)#165
meninoebom wants to merge 2 commits into
feature/priority-backendfrom
feature/priority-ui

Conversation

@meninoebom
Copy link
Copy Markdown
Owner

Summary

  • Adds important and urgent boolean fields to the frontend Task type and API layer
  • Moves the domain filter from an inline pill row on the Today page into a persistent sidebar section (DomainNav) using URL param ?domain_id=<id> for cross-page state
  • Adds ! (important) and (urgent) priority pills to every TaskItem — hidden by default, visible on hover, with active red/amber styling from the prototype spec
  • Q1 tasks (both important + urgent) get a 2px red left border and rgba(239,68,68,0.08) tinted background on the row
  • All priority toggles use optimistic updates with rollback on failure

Changes

  • api-types.ts — add important: boolean and urgent: boolean to Task interface
  • api.ts — add setPriority(id, {important?, urgent?}) calling POST /tasks/{id}/priority
  • components/domain-nav.tsx — new client component: fetches domains + pending tasks, renders sidebar nav with colored dots + task counts, filters via ?domain_id URL param
  • (app)/layout.tsx — import and render DomainNav below main nav items (desktop sidebar only), wrapped in Suspense
  • (app)/today/page.tsx — remove domain pill row, read domainFilter from useSearchParams("domain_id"), wrap in Suspense for production compatibility
  • components/task-item.tsx — add optimistic priority state, handleToggleImportant/handleToggleUrgent with try/catch rollback, priority pills (opacity-0 → visible on group-hover), Q1 row border + bg

Test plan

  • Confirm sidebar shows domain list with task counts after creating domains
  • Click a domain in the sidebar — Today page filters to that domain, URL shows ?domain_id=<id>
  • Click again to clear the filter
  • Hover a task row — ! and pills appear
  • Click ! — pill turns red, task shows important active styling
  • Click — pill turns amber, task shows urgent active styling
  • Both active → row gets 2px red left border + red-tinted background (Q1 styling)
  • Completed tasks show no priority pills
  • Build passes: npm run build exits 0 with no TypeScript errors

🤖 Generated with Claude Code

…debar (#162)

- Add `important` and `urgent` booleans to the Task interface in api-types.ts
- Add `setPriority()` API helper calling POST /tasks/{id}/priority
- Create DomainNav sidebar component fetching domains + pending task counts, with URL param filtering (?domain_id=<id>)
- Add DomainNav to desktop sidebar in layout.tsx (below time bucket nav)
- Remove domain pill row from today/page.tsx; domain filter now reads ?domain_id from URL
- Add ! and ⚡ priority pills to TaskItem: hidden by default, visible on hover, active state with red/amber styling
- Apply Q1 row styling (2px red left border + rgba(239,68,68,0.08) bg) when both important && urgent
- Optimistic updates with rollback on priority toggle

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@railway-app
Copy link
Copy Markdown

railway-app Bot commented Apr 24, 2026

🚅 Deployed to the tend-pr-165 environment in Tend

Service Status Web Updated (UTC)
Tend Frontend ✅ Success (View Logs) Web Apr 24, 2026 at 9:48 am
Tend Backend ✅ Success (View Logs) Apr 24, 2026 at 9:48 am

@railway-app railway-app Bot temporarily deployed to Tend / tend-pr-165 April 24, 2026 09:34 Destroyed
…, DomainNav All

- task-item: sync important/urgent from props via useEffect (stale local state bug)
- task-item: mountedRef guard on rollback setState to avoid unmounted-component update
- task-item: call onMutate() after successful priority toggle so quadrant/list re-sorts
- task-item: add aria-label to ! and ⚡ pills for screen readers
- task-item: Q1 row uses Tailwind bg-red-500/[0.08] instead of inline rgba (theme-safe)
- task-item: remove dead inline style overrides on pills (Tailwind classes now own it)
- domain-nav: add "All" button to clear the domain filter
- domain-nav: distinguish loaded-empty vs load-failed (show null only after data arrives)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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