Skip to content

Polish folder picker, theme switching, and timer UX#3

Open
SagarSDagdu wants to merge 5 commits into
triptu:mainfrom
SagarSDagdu:fix/polish-folder-picker-theme-timer
Open

Polish folder picker, theme switching, and timer UX#3
SagarSDagdu wants to merge 5 commits into
triptu:mainfrom
SagarSDagdu:fix/polish-folder-picker-theme-timer

Conversation

@SagarSDagdu
Copy link
Copy Markdown

@SagarSDagdu SagarSDagdu commented May 16, 2026

Summary

  • Folder picker: NSOpenPanel now exposes the New Folder button and uses a clearer "Choose" confirm label so users can create a notes folder from the picker itself.
  • Theme switching: WindowManager.syncPanelAppearance() resolves the system appearance explicitly and forces the NSHostingView to re-pick it up. Theme switches via the Picker (e.g. Light → System, Light → Dark) used to leave the panel rendered with the old theme until it resigned key — SwiftUI's .preferredColorScheme override on the hosting view wasn't being cleared synchronously.
  • Timer todos as a side panel: the title-bar sidebar.right icon used to swap the timer home view for the todos list. Reworked into a real side panel — TimerHomeView stays as the left pane and TimerTodosView is rendered to its right via a draggable, persistable divider (SidebarState.todosPanelWidth, clamped [220, 450], snaps closed when dragged narrow). Replaces TimerService.Screen enum with todosVisible: Bool + toggleTodosPanel(). Renames titlebar-toggle-timelinetitlebar-toggle-todos.
  • Timer empty-state hint: "Start from the todos list" was static text on a dead-end empty state. It's now a tappable button (accent-coloured) when the panel is hidden, or a "Pick a todo from the list →" cue when it's already open.
  • Title bar text clipping: removed the hard 25-character cap on the active task label — .lineLimit(1) + .truncationMode(.tail) already truncate when space runs out, so the cap was clipping titles even when the title bar had room to render them in full.

Screen recording of the proposed UX

Screen.Recording.2026-05-16.at.5.41.27.PM.mov

Test plan

  • xcodebuild test … -only-testing:FlowbarTests — all 144 unit tests pass (tests updated for the new todosVisible state shape)
  • Folder picker shows "New Folder" button when invoked from Settings
  • Full theme cycle Dark → Light → Dark → Light → Dark via the picker applies on every step without clicking outside the panel
  • Light → System (with system = dark) applies immediately
  • Timer home + todos render side-by-side; title-bar sidebar.right button toggles the panel
  • Divider between home and todos resizes the todos panel; cursor flips to resizeLeftRight; width persists across launches
  • Empty-state hint button opens the todos panel
  • Long task names display fully in the title bar when there is space; truncate with ellipsis when there isn't

- NSOpenPanel for the markdown folder now allows creating a new folder
  and uses a clearer "Choose" prompt
- syncPanelAppearance resolves the system appearance explicitly and
  forces the hosting view to re-pick it up, so theme switches apply
  immediately instead of waiting for the panel to resign key
- "Start from the todos list" hint on the timer home view is now a
  tappable button that routes to the todos screen
The title bar's `sidebar.right` icon suggested a side panel but actually
replaced the timer home view with the todos list. Rework the timer screen
so the home view is always the left pane and the todos list is shown to
the right of it when toggled on (default).

- TimerService: replace `Screen` enum + `screen` field with
  `todosVisible: Bool` and `toggleTodosPanel()`
- TimerContainerView: HStack of TimerHomeView + (optional) TimerTodosView
  separated by a Divider; animated insertion from the trailing edge
- TitleBarView: button now reads `titlebar-toggle-todos` and its icon
  brightens when the panel is open
- MainView: ⌥⌘T closes the todos panel, ⌥⌘L opens it (both ensure the
  timer is the active panel)
- TimerHomeView: empty-state hint adapts — calls out the side panel when
  visible, otherwise offers a button to open it
- Tests and screenshot SKILL.md updated for the new state shape and id
Mirrors the file sidebar's draggable divider, with the delta inverted
so dragging the handle left grows the panel and right shrinks it. Width
is clamped to [220, 450] and persists via `todosPanelWidth` in
SidebarState. Dragging below the collapse threshold snaps the panel
closed by toggling `todosVisible`.
Removed the hard 25-character cap on the active task label. `.lineLimit(1)`
and `.truncationMode(.tail)` already truncate when there's actually no
room, so the cap was clipping titles even when the title bar had space
to render them in full.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

@SagarSDagdu is attempting to deploy a commit to the triptu's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request transitions the Timer screen from a full-screen view switcher to a side-panel layout, allowing the todos list to be displayed alongside the timer. It introduces a resizable divider for the todos panel, persists its width, and improves theme synchronization in the window manager. A review comment suggests grouping the todos panel and its divider in a nested HStack to ensure they share the same transition animation for a smoother visual effect.

Comment thread Flowbar/Sources/Views/Timer/TimerContainerView.swift
The divider had no explicit transition, so it would fade while the todos
view slid out, making the dismissal look ragged. Wrapping both in a
nested HStack with the slide+opacity transition applied to the group
keeps them in sync. Spotted in PR review.
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