Repository navigation
pitis/perch#16: Cards resize by dragging the gap between them, and the widths are kept - #30
Merged
Merged
Conversation
Card widths are now stored as a weight instead of an S/M/L preset, so a dragged width persists. Older files keep their preset's weight. Each card kind has a minimum width the layout never goes below, so controls don't clip or wrap.
Owner
Author
Resizing now turns every card's width on screen into its weight before trading between the two neighbours, so a card held at its minimum no longer makes the others jump or the gap fall behind the pointer. The drag lives in gesture state, so a cancelled drag can't leave stale widths behind, and release saves the cards in one change. A weight no drag could make falls back to the preset when loading, the resize cursor is set rather than pushed, and the comments and product notes say what the code does.
Owner
Author
ReviewRan Fixed
Declined
Not checkedThe drag, the cursor and the save on release in the running app, and the 1:30:00 clock at Focus's 150pt minimum. |
…-16-resize-cards # Conflicts: # Tests/PerchCoreTests/PerchCoreTests.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






Refs #16 (
Refs, notCloses, per AGENTS.md: this hasn't been run in the real app yet, only unit-tested and rendered with sample data)What changed
CardConfig.width(S/M/L enum) is replaced byCardConfig.weight: Double. Older files that store"width": "wide"load as that preset's weight, usinglenientas AGENTS.md requires. The S/M/L picker in Customize still works: it sets the preset's weight, and a dragged width shows no segment selected.CardConfig.Kind.minWidth): Tasks 270pt, Focus 150, Notepad and Events 140. Dragging stops there, and the layout itself (CardLayout.widths) never puts a card below its minimum, which also covers S presets that squeezed a card too far before.Workspaceonce, on release, so the store isn't rewritten every frame.product.md: moved Resize cards by dragging #16 from "not built" to "written, but not tried for real".How it was tested
make check: 46 tests pass, including newCardLayoutTests(proportional widths, minimum floors, resize trading only between neighbours, stopping at either minimum, weight round-trip and old preset files loading).Not done / not run
1:30:00) at Focus's 150pt minimum./pr-review-toolkit:review-pr,/ponytail:ponytail-review) was run. The fixes are in the review comment below.