Replace floating Clear link with a Reset button in profile editors#433
Merged
Conversation
… editors The Clear control sat alone in the top-right corner of the Languages and Rules cards (the section title comes from the enclosing Section, so nothing balanced it), which read as stray. Move it to a proper bordered Reset button at the bottom-right of each editor, with an arrow.counterclockwise icon. Same behavior (restores the default set / clears rules); only the placement and affordance change.
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
In the writing-profile settings, the "Clear" control sat alone in the top-right corner of the Languages and Rules cards. Because the section title comes from the enclosing
Section, nothing balanced it, so it read as a stray link in empty space. Replace it with a proper bordered Reset button (with anarrow.counterclockwiseicon) at the bottom-right of each editor. Behavior is unchanged: it restores the default language set / clears all rules, and still only appears when there's something to reset.Validation
Visual change; confirm in Settings → Writing: the Reset button appears at the bottom-right of the Languages and Rules cards once they differ from defaults, and disappears after resetting. The inline-title (onboarding) layout still renders its title and the same bottom Reset.
Linked issues
Risk / rollout notes
clearLanguages()/clearRules()actions.Greptile Summary
Moves the "Clear" affordance in both
CustomRulesEditorandLanguageTagsEditorfrom a plain link in the card header to a small bordered "Reset" button (Label+arrow.counterclockwise) anchored at the bottom-right of each editor. The visibility gating (canClear) and the underlying actions (clearRules()/clearLanguages()) are unchanged.HStackheader that combined the title and the Clear link is split into a standalone title block and a new bottom-of-VStack Reset button guarded bycanClear.Confidence Score: 5/5
UI-only restructuring with no model or persistence changes; safe to merge.
Both files touch only view layout code. The
canCleargating logic and the underlyingclearRules()/clearLanguages()calls are untouched, so functional behavior is identical to before. The only loose ends are a stale private variable name (canClear) and doc comments in non-diff files that still say "Clear".The stale doc comments in
SuggestionSettingsModel.swiftandCustomRulesCatalog.swift(both outside the diff) are worth a follow-up pass to update "Clear" to "Reset" in the prose.Important Files Changed
canClearnaming is now slightly stale.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Editor renders] --> B{showsTitleHeader?} B -- Yes --> C[Show inline title text] B -- No --> D[Title omitted - Section heading provides it] C --> E[Render chip flow layout if list non-empty] D --> E E --> F[TextField for new entry] F --> G{Suggestions available and under cap?} G -- Yes --> H[Suggestions row] G -- No --> I{canClear? current != defaults} H --> I I -- Yes --> J[Bottom-right Reset button - Label + arrow.counterclockwise] I -- No --> K[Button hidden] J --> L[User clicks Reset] L --> M[clearRules / clearLanguages sets defaults] M --> N[canClear becomes false - Button disappears]Comments Outside Diff (3)
Cotabby/UI/CustomRulesEditor.swift, line 29-31 (link)canClearbut the button it gates is now labelled "Reset". This creates a small cognitive mismatch for future readers who may expectcanClearto guard a "Clear" action. Renaming it tocanResetkeeps the code consistent with the visible UI affordance.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!
Cotabby/UI/LanguageTagsEditor.swift, line 28-30 (link)CustomRulesEditor:canClearguards a "Reset" button. Renaming it tocanReset(and updating the two usage sites below) keeps the variable name aligned with the visible UI label.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!
Cotabby/UI/CustomRulesEditor.swift, line 29-31 (link)SuggestionSettingsModel.clearRules()still carries the doc commentNamed for the UI affordance ("Clear"), andCustomRulesCatalog.swiftlines 8 and 18 both say"Clear" action / "Clear" in the editor. Now that the button is labelled "Reset", these comments are misleading to future readers. They're not part of the current diff but are directly coupled to the rename done 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!
Reviews (1): Last reviewed commit: "Replace floating Clear link with a Reset..." | Re-trigger Greptile