Skip to content

Fix multiline script editor in settings#202

Merged
sbertix merged 5 commits intosupabitapp:mainfrom
yaroslavyaroslav:fix/script-input-field-new-line
Apr 1, 2026
Merged

Fix multiline script editor in settings#202
sbertix merged 5 commits intosupabitapp:mainfrom
yaroslavyaroslav:fix/script-input-field-new-line

Conversation

@yaroslavyaroslav
Copy link
Copy Markdown
Contributor

Problem: pressing Enter in repository settings script fields selected the whole value instead of inserting a newline because the UI used a vertical TextField on macOS.

Fix: switch those script fields to the existing NSTextView-backed PlainTextEditor so Enter inserts a line break normally while keeping the multiline field behavior.

Copy link
Copy Markdown
Collaborator

@sbertix sbertix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100% with wanting to get the newline back, but any specific actual reason to prefer the custom PlainTextEditor to just a vanilla TextEditor(…).textEditorStyle(.plain).autocorrectionDisabled().monospaced().frame(height: …) for this specific case?

PlainTextEditor(
text: text,
isMonospaced: true,
style: .field
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it would possibly need to be .plain to match the rest of the app? 🤔 with this we're getting a bordered white box

@yaroslavyaroslav
Copy link
Copy Markdown
Contributor Author

It's actually that PlainTextEditor is used in ContentView.swift. So nothing that specific.

@sbertix
Copy link
Copy Markdown
Collaborator

sbertix commented Apr 1, 2026

It's actually that PlainTextEditor is used in ContentView.swift. So nothing that specific.

We'll get to it too in time 😅 since neither needs to auto-grow and all modifiers can be represented, I'd just go with TextEditor for this.

Comment thread supacode/Features/Settings/Views/RepositorySettingsView.swift Outdated
Comment thread supacode/Features/Settings/Views/RepositorySettingsView.swift Outdated
yaroslavyaroslav and others added 2 commits April 1, 2026 15:53
Co-authored-by: Stefano Bertagno <stefano@bertagno.com>
Co-authored-by: Stefano Bertagno <stefano@bertagno.com>
@sbertix
Copy link
Copy Markdown
Collaborator

sbertix commented Apr 1, 2026

Thanks 🙇‍♂️

@sbertix sbertix merged commit 5016e25 into supabitapp:main Apr 1, 2026
1 check passed
@yaroslavyaroslav yaroslavyaroslav deleted the fix/script-input-field-new-line branch April 1, 2026 15:44
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.

2 participants