Skip to content

Fix two layouts in the New loop dialog the templates work broke - #234

Merged
scgopi merged 1 commit into
mainfrom
fix/template-dialog-layout
Sep 1, 2026
Merged

Fix two layouts in the New loop dialog the templates work broke#234
scgopi merged 1 commit into
mainfrom
fix/template-dialog-layout

Conversation

@scgopi

@scgopi scgopi commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Both regressions came from the design-fidelity pass in #231, and both are visible in a single screenshot.

The applied strip was a scrambled sentence

The shape sentence, the Undo the shape button and the clause after it sat in an HStack. When the sentence wrapped, its second line went under the button and the words after it, so what you actually read was:

This template makes it a Timed loop and sets Undo the shape to keep just the prompt.
a cadence.

It is now one Text carrying an inline link, which flows with the words around it — the only spelling that survives wrapping. The link is intercepted by the strip's own OpenURLAction, and the type name is emphasised the way the design canvas draws it.

This template makes it a Timed loop and sets a cadence. Undo the shape to keep just the prompt.

The footer had no room

The save notice sat between the Spacer and the primary button, and there isn't enough width for both:

Was Now
Path truncated to Saved…op.md Full-width row, path readable
"Put it in the project instead" wrapped onto three lines One line
Create timed loop wrapped onto two lines One line, fixed-size

A dialog's primary action must never wrap. The notice gets a row of its own above the buttons; the disabled-reason text truncates rather than squeezing the button.

How it was checked

By rendering the dialog headless (NSHostingView → PNG) and looking at it — not by reading the code, which is how both of these got through in the first place.

NodeDraftForm went over swiftlint's type-body limit with the fix, so the template chrome moved to NodeDraftTemplateBar.swift, the way ProjectFeature's template verbs already live beside it rather than inside it.

Verification

  • Build succeeds; 1482 tests in 153 suites pass
  • swiftlint lint0 errors; swift format lint --strict — clean
  • Layout confirmed visually from the headless render

🤖 Generated with Claude Code

https://claude.ai/code/session_01MJR8Wuwc4qnaSBUMcYf7Af

Both from the design-fidelity pass, and both visible in one screenshot.

**The applied strip was a scrambled sentence.** The shape sentence, the `Undo
the shape` button and the clause after it sat in an `HStack`, so when the
sentence wrapped, its second line went *under* the button and the words after
it — what you read was "…and sets Undo the shape to keep just the prompt. a
cadence." It is now one `Text` carrying an inline link, which flows with the
words around it; the link is intercepted by the strip's own `OpenURLAction`.
The type name is emphasised, as the canvas draws it.

**The footer had no room.** The save notice sat between the Spacer and the
primary button, and there is not enough width for both: the path truncated to
"Saved…op.md", "Put it in the project instead" wrapped onto three lines, and
`Create timed loop` itself wrapped onto two. A dialog's primary action must
never wrap. The notice now has a full-width row of its own above the buttons,
the button is `lineLimit(1)` and fixed-size, and the disabled-reason text
truncates rather than squeezing it.

Verified by rendering the dialog headless (`NSHostingView` → PNG) rather than
by reading the code, which is how both of these got through in the first place.

`NodeDraftForm` went over swiftlint's type-body limit with the fix, so the
template chrome — the applied strip and the footer — moved to
`NodeDraftTemplateBar.swift`, the way `ProjectFeature`'s template verbs already
live beside it.

1482 tests pass, swiftlint 0 errors, swift-format clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MJR8Wuwc4qnaSBUMcYf7Af
@scgopi
scgopi merged commit 7f5314d into main Sep 1, 2026
1 check passed
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