Skip to content

Choose a widget's size when adding it - #31

Open
edward-mcnair wants to merge 1 commit into
kemalandic:mainfrom
edward-mcnair:widget-size-picker
Open

edward-mcnair wants to merge 1 commit into
kemalandic:mainfrom
edward-mcnair:widget-size-picker

Conversation

@edward-mcnair

Copy link
Copy Markdown

What does this PR do?

The catalog's + added a widget at its default size, so any other size meant adding it and then resizing in edit mode, or using the Pages tab's column and row controls.

+ now opens a short list of named sizes the widget supports: Small, Medium, Large, Wide and Tall.

  • Page map: each size shows a small map of the current page: existing widgets in grey, the new one in the accent colour where it will land.
  • No room: a size that doesn't fit is marked. It's then placed overlapping at the top-left and edit mode opens, as a full page did before.
  • Custom: a Custom row covers any other width × height the widget allows.

The column and row controls in the Pages tab are unchanged.

The choices come from WidgetSizeOptions, a pure function of the widget's range, its default and the page grid. Tests: WidgetSizeOptionsTests (7 cases).

Screenshots

(Screenshot of the picker to be attached.)

Checklist

  • Tested on macOS 14+ (macOS 27)
  • No third-party dependencies added
  • Follows existing code style (swift-format lint clean)

🤖 Generated with Claude Code

The catalog's + added a widget at its default size, so getting any other
size meant adding it and then resizing in edit mode or with the Pages
tab's column and row controls.

+ now opens a short list of named sizes the widget supports (Small, Medium,
Large, Wide, Tall), each with a map of the current page that shows where
it will land and which other widgets are already there. A size with no
free space is marked: it is placed overlapping at the top-left and edit
mode opens, as a full page did before. A Custom row covers any other
width and height the widget allows. The column and row controls in the
Pages tab are unchanged.

The choices come from WidgetSizeOptions, a pure function of the widget's
size range, its default and the page grid, with tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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