fix(filters): disable smart substitution in cell editors and filter inputs#1149
Merged
datlechin merged 1 commit intoMay 9, 2026
Merged
Conversation
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.
Summary
Six SwiftUI
TextFieldsites and one AppKitNSTextFieldsubclass now disable the system field-editor's smart-substitution behaviour:SingleLineEditorView,MultiLineEditorView,BlobHexEditorView(right-sidebar cell editors)FilterRowViewsecond-valueTextFieldFilterPanelViewpreset name alertTextFieldCreateTableViewtable-nameTextFieldFilterValueTextField(AppKit, used by the primary filter operand)The SwiftUI sites use
.autocorrectionDisabled(true). The AppKit field is now backed by a privateSubstitutionDisabledTextField: NSTextFieldthat overridesbecomeFirstResponder()and disables all four flags on the live field editor (isAutomaticQuoteSubstitutionEnabled,isAutomaticDashSubstitutionEnabled,isAutomaticTextReplacementEnabled,isAutomaticSpellingCorrectionEnabled) once super has installed the editor.Why this matters
This is HIG audit findings 5.1 + 5.2. macOS's default field editor turns straight quotes into curly quotes and
--into an em-dash. For database cell values, filter operands, identifiers, and hex bytes, that's silent data corruption: a typedWHERE name LIKE "Bob's"arrives at the database with curly quotes and stops matching. The four files that already disable substitutions (JSONSyntaxTextView,HexEditorContentView,ConnectionAdvancedView,AIRulesPaneView) were the model.The AppKit subclass is the Apple-recommended primitive: configure substitutions on the field editor after super installs it, encapsulated with the type so it travels with every use of
FilterValueTextField.Test plan
"hello"in a cell editor and confirm the quotes stay straight.--in a filter value and confirm it stays as two hyphens, not an em-dash.FilterValueTextField, confirm no substitution.