Add Label Visibility Settings (#87)#164
Conversation
Adds independent toggles to hide letters, standard symbols, and extra symbols on the keyboard so users can practice the MessagEase layout from memory. Numbers and functional keys stay visible. Classification is character-based (via LabelCategory) rather than slot-based, so language-specific overrides inherit the correct category automatically. - LabelCategory: derives category from character content - LabelVisibilitySettings: SharedDefaults-backed observable - KeyboardViewModel.displayText / KeyHintOverlay: suppress hidden labels - LabelVisibilitySettingsView: host-app settings screen with live preview
📝 WalkthroughWalkthroughAdded a label visibility feature allowing users to toggle display of letters, standard symbols, and extra symbols through a new settings UI. Introduced Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant SettingsUI as Settings UI<br/>(LabelVisibilitySettingsView)
participant AppStorage as AppStorage/<br/>UserDefaults
participant ViewModel as KeyboardViewModel
participant LVSettings as LabelVisibilitySettings
participant KeyHint as KeyHintOverlay
participant Keyboard as Keyboard View
User->>SettingsUI: Toggle "Show Letters"
SettingsUI->>AppStorage: Persist hideLetters = false
AppStorage->>LVSettings: Observe change
LVSettings->>ViewModel: objectWillChange (via forwarding)
ViewModel->>LVSettings: reload()
ViewModel->>Keyboard: update displayText(for:)
Keyboard->>LVSettings: isVisible(.letter)?
alt Letter visible
LVSettings->>Keyboard: return true
Keyboard->>KeyHint: render letter label
else Letter hidden
LVSettings->>Keyboard: return false
Keyboard->>KeyHint: render empty label
end
KeyHint->>Keyboard: display updated key hints
Keyboard->>User: Updated keyboard shown
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
wurstfingerKeyboard/KeyboardViewModel.swift (1)
323-333:⚠️ Potential issue | 🟠 MajorUse locale-aware uppercasing for center labels.
Line 331 uses
uppercased()without locale, diverging from the keyboard's i18n design. Other UI-rendering methods in the codebase (KeyHintOverlay, resolvedText) already use locale-aware variants. Thelocaleproperty is accessible within KeyboardViewModel, so the fix is straightforward:Proposed fix
case .upper: - key.center.uppercased() + key.center.uppercased(with: locale)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@wurstfingerKeyboard/KeyboardViewModel.swift` around lines 323 - 333, The center label uppercasing uses uppercased() without locale; update the KeyboardViewModel code that returns key.center in the activeLayer .upper case to call the locale-aware API (use uppercased(with: locale)) so the label respects the VM's locale property; locate the switch on activeLayer in KeyboardViewModel around the key.center handling and replace the plain uppercased() call with the locale-aware variant (keeping the .lower case behavior unchanged unless you want symmetry).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@wurstfingerKeyboard/KeyboardViewModel.swift`:
- Around line 323-333: The center label uppercasing uses uppercased() without
locale; update the KeyboardViewModel code that returns key.center in the
activeLayer .upper case to call the locale-aware API (use uppercased(with:
locale)) so the label respects the VM's locale property; locate the switch on
activeLayer in KeyboardViewModel around the key.center handling and replace the
plain uppercased() call with the locale-aware variant (keeping the .lower case
behavior unchanged unless you want symmetry).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5bbdebc7-90f9-421e-9f3b-5c1d6a069466
⛔ Files ignored due to path filters (1)
wurstfinger.xcodeproj/project.pbxprojis excluded by!**/*.xcodeproj/**
📒 Files selected for processing (9)
wurstfinger/LabelVisibilitySettingsView.swiftwurstfinger/SettingsView.swiftwurstfinger/wurstfingerApp.swiftwurstfingerKeyboard/KeyHintOverlay.swiftwurstfingerKeyboard/KeyboardRootView.swiftwurstfingerKeyboard/KeyboardSettings.swiftwurstfingerKeyboard/KeyboardViewModel.swiftwurstfingerKeyboard/LabelCategory.swiftwurstfingerUITests/wurstfingerUITests.swift
Summary
LabelCategoryclassification so language-specific overrides (ä, ö, ü, …) inherit the correct category automaticallyLabel Visibilitysettings screen with a liveInteractiveKeyboardPreviewCloses #87
Implementation notes
LabelCategory.swift: classifies a character intoletter/standardSymbol/extraSymbol/number/functional; also exposesMessagEaseOutput.labelCategoryfor hint labelsLabelVisibilitySettings:SharedDefaults-backedObservableObject, same pattern asHapticSettings/LayoutSettings; wired intoKeyboardViewModelKeyboardViewModel.displayText(for:)returns an empty string when the center character's category is hiddenKeyHintOverlayconsults the settings per direction and skips rendering hidden hintsLabelVisibilitySettingsViewwith three "Show …" toggles (inverted bindings against thehide*keys) and a footer explaining the feature; linked from the Appearance section ofSettingsViewfalsefor all three) registered inwurstfingerApp.init()Test plan
xcodebuild buildon iPhone 17 Pro simulator (iOS 26)Summary by CodeRabbit