Skip to content

refactor(settings): regroup acceptance toggles under Writing, split General behavior#696

Merged
FuJacob merged 1 commit into
mainfrom
settings-acceptance-regroup
Jun 12, 2026
Merged

refactor(settings): regroup acceptance toggles under Writing, split General behavior#696
FuJacob merged 1 commit into
mainfrom
settings-acceptance-regroup

Conversation

@FuJacob

@FuJacob FuJacob commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

The two acceptance toggles lived in General > Behavior, mixed in with context
sources and macros where they read as out of place. They govern what an accept
inserts, so they now sit in a new Writing > Acceptance section next to the
other controls that shape inserted text. General's catch-all Behavior section is
split into Context (clipboard/app) and Suggestions (multi-line/macros)
so each group reads cleanly.

  • Moved "Accept Punctuation With Word" and "Add Space After Accepting" to Writing.
  • Split General > Behavior into Context + Suggestions.
  • Updated the Settings search index so both toggles resolve to the Writing pane.

Validation

swiftlint lint --quiet
# exit 0

xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination 'platform=macOS' build \
  -derivedDataPath build/DerivedData
# ** BUILD SUCCEEDED **

Pure presentation move: the same bindings drive the same SuggestionSettingsModel
setters, so stored preferences and behavior are unchanged. Existing SettingsIndex
tests (title/symbol/keywords presence, id uniqueness, search) are category-agnostic
and unaffected.

Linked issues

None.

Risk / rollout notes

  • UI-only reorganization. No settings schema or storage change; toggle state and
    acceptance behavior are identical.
  • Search keywords for both toggles are unchanged, so existing queries still surface
    them (now pointing at the Writing pane).

Greptile Summary

This PR reorganizes the Settings UI by splitting the old General > Behavior catch-all into two focused sections (Context and Suggestions) and relocating the two acceptance toggles to a new Writing > Acceptance section where they fit more naturally alongside other output-shaping controls.

  • GeneralPaneView: "Behavior" replaced by "Context" (clipboard/app toggles) and "Suggestions" (multi-line/macros); the acceptance bindings are fully removed.
  • WritingPaneView: New "Acceptance" section inserted between "Length" and "Corrections" with both toggles wired to the same SuggestionSettingsModel setters as before.
  • SettingsIndex: acceptPunctuation and addSpaceAfterAccept cases moved to the Writing declaration block and their category switch arms updated to return .writing, keeping search routing accurate.

Confidence Score: 5/5

Pure UI reorganization — no settings schema, storage, or behavioral change; safe to merge.

All three files touch only presentation layer code: section labels, toggle placement, and the search index routing. The underlying SuggestionSettingsModel bindings are identical to the originals, and the category switch in SettingsIndex is updated to match, so search still routes to the correct pane. No logic paths, data mutations, or persistence are involved.

No files require special attention; the only note is a minor docstring gap in WritingPaneView.swift.

Important Files Changed

Filename Overview
Cotabby/UI/Settings/Panes/GeneralPaneView.swift Old "Behavior" section split into "Context" (clipboard/app) and "Suggestions" (multi-line/macros); acceptance toggles and their bindings removed cleanly.
Cotabby/UI/Settings/Panes/WritingPaneView.swift New "Acceptance" section added between "Length" and "Corrections"; both toggles and their bindings are correctly wired to the same SuggestionSettingsModel setters. File-level docstring omits the new section.
Cotabby/UI/Settings/SettingsIndex.swift acceptPunctuation and addSpaceAfterAccept cases moved from the General block to the Writing block; category switch updated correctly to return .writing for both.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph BEFORE["Before (General > Behavior)"]
        B_Behavior["Behavior"]
        B_Behavior --> B_Clipboard["Include Clipboard Context"]
        B_Behavior --> B_App["Include App Context"]
        B_Behavior --> B_MultiLine["Allow Multi-line Suggestions"]
        B_Behavior --> B_Punct["Accept Punctuation With Word ❌"]
        B_Behavior --> B_Space["Add Space After Accepting ❌"]
        B_Behavior --> B_Macros["Inline Macros"]
    end

    subgraph AFTER_G["After (General)"]
        A_Context["Context"]
        A_Context --> A_Clipboard["Include Clipboard Context"]
        A_Context --> A_App["Include App Context"]
        A_Suggestions["Suggestions"]
        A_Suggestions --> A_MultiLine["Allow Multi-line Suggestions"]
        A_Suggestions --> A_Macros["Inline Macros"]
    end

    subgraph AFTER_W["After (Writing)"]
        A_Acceptance["Acceptance ✅"]
        A_Acceptance --> A_Punct["Accept Punctuation With Word"]
        A_Acceptance --> A_Space["Add Space After Accepting"]
    end

    B_Punct -->|moved| A_Punct
    B_Space -->|moved| A_Space
Loading

Comments Outside Diff (1)

  1. Cotabby/UI/Settings/Panes/WritingPaneView.swift, line 3-6 (link)

    P2 The file-level docstring lists what the Writing pane owns but doesn't mention the new "Acceptance" section, so a reader skimming the header won't know these toggles live here.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Fix in Codex Fix in Claude Code

Fix All in Codex Fix All in Claude Code

Reviews (1): Last reviewed commit: "refactor(settings): group acceptance tog..." | Re-trigger Greptile

…eral behavior

Move 'Accept Punctuation With Word' and 'Add Space After Accepting' out of
General into a new Writing > Acceptance section, next to the other controls
that shape inserted text. Split General's catch-all Behavior section into
Context (clipboard/app) and Suggestions (multi-line/macros). Update the
search index category mapping so both toggles resolve to Writing.
@FuJacob FuJacob merged commit 269dca5 into main Jun 12, 2026
4 checks passed
@FuJacob FuJacob deleted the settings-acceptance-regroup branch June 12, 2026 06:33
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