Skip to content

feat(notes): a slimmer roll-up bar that snaps to the bottom, and a one-row header - #19

Merged
kasvith merged 5 commits into
mainfrom
feat/roll-up-bar
Nov 6, 2026
Merged

kasvith merged 5 commits into
mainfrom
feat/roll-up-bar

Conversation

@kasvith

@kasvith kasvith commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Closes #18.

What changes

Roll-up bar (#18)

  • A rolled-up note is a 34pt bar: the note's own top row, showing the title, the open-task count, and on hover expand / pin / close. Rolling works like a window shade, so nothing jumps.
  • A note near the bottom of the screen rolls up flush to the bottom, and a bar dropped within 48pt of the bottom glides down flush. A bar parked there expands upward and never runs off the screen.
  • While rolled up the window is frameless and draws its own capsule, with no shadow. A titled window's fixed 16pt corners split from a thin bar's fill, and a frameless window's shadow outlines it like a border.

Header

  • The title shares the top row with roll up, pin and close. Colors, glass, the completed-task options, New List, Clean Up and Rename… are in the ⋯ popover.
  • The title is part of the drag handle: a press drags and a double-click rolls up. Before, a double-click on the title let macOS zoom the window.
  • Rename shows an outlined field: Return or clicking away saves, Esc restores the old name. A new list opens ready for its name.
  • The hover controls now appear reliably: they're driven by an AppKit tracking area instead of SwiftUI's onHover. Every control darkens under the pointer.

Window handling

  • The roll animates with animator(), not the blocking setFrame(_:display:animate:). The content has no minimum height, so the hosting view doesn't jump the window; windowWillResize keeps open notes at least 160pt and locks a bar's height.
  • Notes drag themselves (NotePanel.performDrag). The system window drag returns at once, settles windows dropped at a screen edge, and swallowed a double-click's second click. A drag starts only once the pointer moves.

Testing

  • swift test: 164 tests pass. New tests cover:
    • the roll/snap geometry
    • dropping a bar near the bottom versus higher up
    • the bar's frameless, shadowless state and height lock
    • the title being part of the drag handle
    • renaming with Return and Esc, driven through a real hosted note
  • swiftlint: no new warnings.
  • Tried by hand in the dev build: rolling up and down (mid-screen and at the bottom), dropping a bar near the bottom on both displays, the ⋯ popover, renaming, and hover reveal.

…e-row header

Rolling a note up (issue #18) now leaves a 34pt bar instead of a tall
title strip, and the note's header is a single row that the bar reuses.

- The bar is the note's top row: its title, the open-task count, and on
  hover expand / pin / close. Rolling is a window shade: nothing moves,
  and the list leaves only once the window is shut. While rolled up the
  window is frameless and draws its own capsule, with no shadow (macOS
  rounds a titled window at 16pt, and a frameless window's shadow rims
  the capsule like a border).
- A note whose bottom is within 48pt of the screen's bottom rolls from
  there, and a bar let go near the bottom glides down flush. Either way
  it expands upward and never runs off the screen.
- The roll animates with animator() rather than the blocking
  setFrame(_:display:animate:), so the content keeps pace. The content
  has no minimum height (the hosting view jumped an expand to ~150pt);
  windowWillResize keeps an open note at least 160pt and a bar's height
  fixed.
- Header: the title shares the top row with roll up, pin and close.
  Colors, glass, the completed-task options, New List, Clean Up and
  Rename live under ⋯. The title is part of the drag handle, so a
  double-click rolls the note up instead of letting macOS zoom it.
  Rename swaps in an outlined field: Return or clicking away saves, Esc
  restores. A new list starts with its name being typed.
- Notes drag themselves (NotePanel.performDrag) instead of using the
  system window drag, which returns at once, settles windows let go at
  a screen edge, and swallowed a double-click's second click. The drag
  starts only once the pointer moves.
- The hover reveal uses an AppKit tracking area (HoverArea), since
  SwiftUI's onHover often didn't show the header controls until the note
  had been clicked into. Every control darkens under the pointer.
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Focus lands a few run-loop turns after a rename request; CI's slower
runner hadn't got there yet.
Setting the focus during onAppear can be ignored (CI's macOS 15 runner
never focused it); a .task runs once the field is on screen.
…f spinning the run loop

The test's synchronous run-loop pump held the main actor, so the rename's
main-actor tasks never ran on CI. The title field is AppKit, taking first
responder itself, so it doesn't depend on SwiftUI focus behaviour per macOS
version.
@kasvith
kasvith merged commit 7b789a2 into main Nov 6, 2026
3 checks passed
@kasvith
kasvith deleted the feat/roll-up-bar branch November 6, 2026 08:03
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