Skip to content

fix: Fix template creation form alignment and growth#637

Merged
yazins-ai merged 4 commits into
yazinsai:mainfrom
jasnoorgill:fix/template-creation-form-layout
May 23, 2026
Merged

fix: Fix template creation form alignment and growth#637
yazins-ai merged 4 commits into
yazinsai:mainfrom
jasnoorgill:fix/template-creation-form-layout

Conversation

@jasnoorgill
Copy link
Copy Markdown
Contributor

Summary

The new template creation form (Settings → Templates → New Template) had two layout bugs caused by being nested inside a Form { .formStyle(.grouped) }:

  • Text field right-aligned: macOS grouped Form applies trailing column alignment to all content, and SwiftUI modifiers like .multilineTextAlignment(.leading) and .environment(\.multilineTextAlignment, .leading) cannot override it from within
  • Notes Prompt box grew with content: Form row height management ignored .frame(height:) and .clipped() constraints

Fix: Moved the creation VStack out of the Form entirely, rendering it directly in the ScrollView. This removes Form's layout engine from the picture entirely.

Additional improvements while here:

  • Upgraded Name / Icon / Notes Prompt labels to size 13, semibold for clearer visual hierarchy
  • Moved "e.g. Sprint Planning" hint inline with the Name label instead of as a separate row
  • Reduced text field width slightly with Spacer(minLength: 20)
  • Replaced TextEditor with a custom FixedLeftTextEditor (NSViewRepresentable) that sets NSTextView.alignment = .left directly and implements sizeThatFits to pin height at 100pt regardless of content

How to test

  1. Open Settings → Templates
  2. Click New Template
  3. Type in the Name field — text should be left-aligned and the row should stay single-line height
  4. Type a long prompt in Notes Prompt — the box should stay fixed at 100pt and scroll internally

Jasnoor Gill and others added 3 commits May 22, 2026 19:36
The DisclosureGroup label only registered taps on the text and chevron.
Added a full-width HStack with Spacer and used the padding/-padding trick
to extend contentShape into the Form row's vertical insets, making the
entire light-colored rectangle tappable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The borderlessButton menu style renders its own indicator chevron,
while the label already contained an explicit chevron.down icon,
resulting in two chevrons appearing side by side. Added
.menuIndicator(.hidden) to suppress the automatic one.

Affects all three Ollama model pickers: Notes Generation,
Knowledge Base Retrieval, and Classic Suggestions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…owth

The creation form was inside a Form with .formStyle(.grouped), which
applied column layout causing right-aligned text fields and auto-growing
row heights that couldn't be overridden with SwiftUI modifiers.

Changes:
- Move creation VStack outside the Form into the ScrollView directly
- Upgrade Name/Icon/Notes Prompt labels to size 13 semibold
- Place "e.g. Sprint Planning" hint inline with the Name label
- Add Spacer(minLength: 20) to slightly reduce the text field width
- Replace TextEditor with FixedLeftTextEditor (NSViewRepresentable) for
  reliable left alignment and fixed height via sizeThatFits

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jasnoorgill jasnoorgill force-pushed the fix/template-creation-form-layout branch from 9fe1478 to cb69a7f Compare May 23, 2026 02:36
@yazins-ai yazins-ai added kind:ux Copy, layout, interaction, polish state:ready-to-merge All checks pass, ready for merge risk:low Docs, scripts, isolated code — autonomous resolution:none Active, not yet resolved release:patch Patch version bump labels May 23, 2026
@yazins-ai yazins-ai merged commit d65a54e into yazinsai:main May 23, 2026
3 checks passed
@yazins-ai
Copy link
Copy Markdown
Collaborator

Thanks @jasnoorgill. Moving the template editor out of the grouped Form fixes the alignment and prompt growth issues cleanly, and the fixed-height text editor keeps the form stable.

@yazins-ai yazins-ai added state:done Completed resolution:merged PR merged and removed state:ready-to-merge All checks pass, ready for merge resolution:none Active, not yet resolved labels May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:ux Copy, layout, interaction, polish release:patch Patch version bump resolution:merged PR merged risk:low Docs, scripts, isolated code — autonomous state:done Completed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants