ProjectTaskPicker — combined picker fixes missing task select in popover#29
Conversation
…ct in popover Single combobox replacing the ProjectPicker+TaskPicker pair wherever both are used together. Tree layout: "(No project)" sentinel at top, project headers rendered bold with a chevron, tasks indented underneath. Project rows are selectable (selecting one yields project-only, task_id=null). Smart search: typing filters both projects and tasks. Tasks matching the query auto-expand their parent project; if the parent's name doesn't match the parent shows dimmed (still clickable for project-only). All projects collapsed by default; opening the dropdown with a current task selected auto-expands its parent so the value is visible. Keyboard: ↑↓ traverse visible rows, Enter selects, Esc closes, Right expands a collapsed project, Left collapses an expanded one (or jumps from a task back to its parent). Why: the popover had no TaskPicker at all (regression from 6c — the parallel task-assignment work added TaskPicker to TimerCard + EditEntryDialog but missed the popover route). Adding a second combobox there would crowd the layout; the combined picker handles it naturally and brings the same unified shape to TimerCard and the EditEntryDialog. The simpler ProjectPicker stays in use for Settings (default project) and CalendarSection (calendar default project) — those genuinely want project-only and no tasks. Tests: 11 new unit tests covering placeholder/value rendering, click + keyboard selection, auto-expand on selected-task, smart search filter, done-task exclusion, and the empty-state message. Existing tests for TimerCard, EditEntryDialog, EntryRow, Today, and Popover updated to match the new aria-label and combined layout.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4673278351
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| projectId() || undefined, | ||
| undefined, | ||
| projectId() ?? undefined, | ||
| taskId() ?? undefined, |
There was a problem hiding this comment.
Clear the popover task selection after starting a timer
When a timer is started from the menu-bar popover with a task selected, the success callback at lines 102–106 resets the description, billable flag, and start time but leaves taskId unchanged. After the user stops that timer, the next popover form therefore remains preselected to the previous task and this argument silently assigns a subsequent timer to it unless the user explicitly clears the picker. The main-window TimerCard clears its task selection after a successful start, and the popover should do the same while preserving the existing project-retention behavior.
Useful? React with 👍 / 👎.
Three iteration tweaks based on local testing: 1. Chevron clarity — bigger button (h-6 w-6 instead of h-4 w-4), SVG caret instead of unicode ▸/▾, only rendered for projects that actually have tasks. Projects without tasks get a bullet • in the same column so the layout aligns and they don't hint at expansion. 2. Search expansion stickiness — split expansion into user-driven and search-driven sets. Clearing the query collapses search-only expansions back; user-driven expansions persist. 3. Task styling — drop the ↳ prefix, indent more (w-6 spacer + w-4 dash column), smaller font (text-xs) + muted color (text-zinc-600). Tasks now get a leading – instead of ↳. 3 new tests for the search-expansion separation + chevron-absence on empty projects. Total 14 picker tests.
Codex flagged on PR #29: the popover's success callback resets description / billable / startAt but leaves taskId in place. Result — after the user stops a timer started with a task, the next popover start silently inherits that task unless they explicitly clear the picker. TimerCard already clears both project and task; the popover was the inconsistent one. Fix only resets taskId. projectId stays — the pre-picker popover preserved project across back-to-back timer starts and users rely on that for working on the same project repeatedly.
|
🎉 This PR is included in version 0.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
ProjectTaskPickercombined component — tree dropdown with project headers + indented tasks. Project rows are selectable (project-only); task rows yield project + task atomically.Popover.tsx(fixes the actual bug — the popover had no task picker at all post-6c),TimerCard.tsx(replaces ProjectPicker+TaskPicker pair in start form + live entry), andEditEntryDialog.tsx(same).ProjectPickerstays in use for Settings (default project) and CalendarSection (calendar default project) — those genuinely want project-only.UX details
↳.doneare excluded.Test plan
🤖 Generated with Claude Code