Repository navigation
Fix font removal menu behavior - #1
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
|
||
| chmod +x "$mock_bin/fc-list" "$mock_bin/pacman" "$mock_bin/omarchy-font-current" | ||
|
|
||
| for requested in 'Liberation Mono?' 'liberation-font?'; do |
There was a problem hiding this comment.
Both test inputs append ? to a complete installed name. Since ? requires one more character, neither input matches the fixture even with the old, unquoted comparisons. The test therefore passes without the fix and will not catch the original bug returning. Use inputs such as Liberation Mon? and liberation-fon?, and stub removal helpers so a regression cannot launch real commands.
Prompt To Fix With AI
This is a comment left during a code review.
Path: test/shell.d/font-remove-test.sh
Line: 44
Comment:
**Test misses the original bug**
Both test inputs append `?` to a complete installed name. Since `?` requires one more character, neither input matches the fixture even with the old, unquoted comparisons. The test therefore passes without the fix and will not catch the original bug returning. Use inputs such as `Liberation Mon?` and `liberation-fon?`, and stub removal helpers so a regression cannot launch real commands.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| TEST_CURRENT_FONT="Some other font" TEST_PKG_DROP_LOG="$test_tmp/pkg-drop-success.log" \ | ||
| TEST_NOTIFICATION_LOG="$test_tmp/notification-success.log" \ | ||
| PATH="$mock_bin:$ROOT/bin:$PATH" bash "$ROOT/bin/omarchy-font-remove" --do "Liberation Mono" >"$test_tmp/output" 2>&1 || |
There was a problem hiding this comment.
The new success test runs the real fc-cache -f with the caller's HOME. On a machine with fontconfig installed, this can rebuild the developer's font caches whenever the test runs. The repository's test guide requires tests that touch user state to use a temporary HOME and stub commands that change host state. Add an fc-cache stub before running this path; this requirement must be satisfied before merging.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: test/shell.d/font-remove-test.sh
Line: 100-102
Comment:
**Tests change host font caches**
The new success test runs the real `fc-cache -f` with the caller's `HOME`. On a machine with fontconfig installed, this can rebuild the developer's font caches whenever the test runs. The repository's test guide requires tests that touch user state to use a temporary `HOME` and stub commands that change host state. Add an `fc-cache` stub before running this path; this requirement must be satisfied before merging.
**Context Used:** AGENTS.md ([source](https://github.com/itscallssh/omarchy/blob/dev/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.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!
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| [[ -n $candidate ]] || continue | ||
| tries+=("$candidate") | ||
| # The menu marks the active font "Family (active)"; also try without it. | ||
| [[ $candidate == *" ("*")" ]] && tries+=("${candidate% (*)}") |
There was a problem hiding this comment.
Unknown names remove installed fonts
lookup_font strips any trailing parenthesized text, even from direct requests. If Liberation Mono is installed and another font is active, omarchy-font-remove --do 'Liberation Mono (missing)' removes Liberation Mono instead of reporting an unknown name.
Limit this step to the menu's active marker, or resolve menu selections by their package field.
Prompt To Fix With AI
This is a comment left during a code review.
Path: bin/omarchy-font-remove
Line: 364
Comment:
**Unknown names remove installed fonts**
`lookup_font` strips any trailing parenthesized text, even from direct requests. If Liberation Mono is installed and another font is active, `omarchy-font-remove --do 'Liberation Mono (missing)'` removes Liberation Mono instead of reporting an unknown name.
Limit this step to the menu's active marker, or resolve menu selections by their package field.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| font.removeNone) printf 'Nothing to remove\n' ;; | ||
| font.removeNoneBody) printf 'No package-installed fonts found\n' ;; | ||
| font.removeNoneLeft) printf 'The remaining fonts are in use or needed by other packages\n' ;; | ||
| font.removeNotFound) printf 'Font not found\n' ;; | ||
| font.removeNotFoundBody) printf "%s is not among the removable fonts\n" "${1:-}" ;; |
There was a problem hiding this comment.
The new notifications use five keys missing from the English catalog: font.removeNone, font.removeNoneBody, font.removeNoneLeft, font.removeNotFound, and font.removeNotFoundBody. Their English text exists only in t, so translation sync cannot translate these messages.
The translation guide requires an English catalog entry for every user-facing CLI string. Add these five entries to default/i18n/en/cli.json before merging to satisfy that requirement.
File Used: docs/i18n.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: bin/omarchy-font-remove
Line: 74-78
Comment:
**Font errors stay in English**
The new notifications use five keys missing from the English catalog: `font.removeNone`, `font.removeNoneBody`, `font.removeNoneLeft`, `font.removeNotFound`, and `font.removeNotFoundBody`. Their English text exists only in `t`, so translation sync cannot translate these messages.
The translation guide requires an English catalog entry for every user-facing CLI string. Add these five entries to `default/i18n/en/cli.json` before merging to satisfy that requirement.
**File Used:** `docs/i18n.md` ([source](https://github.com/itscallssh/omarchy/blob/54a92340deccfe70820fef9fe8a0a4bc3ba41dc6/docs/i18n.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.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!
The font removal command had several issues that prevented it from meeting the CLI, translation, and package-management conventions. The menu and picker now have English catalog entries, the command uses
omarchy-i18nfor picker and notification text, and the displayed font-family/package mapping excludes the active package from both the picker and--list. Removal delegates toomarchy-pkg-drop, and the command now has explicit CLI summary metadata.Validation was not run in this session.
This PR needs changes before merging because an unknown name can remove an installed font, and explicit translation and test-isolation requirements remain unmet.
Fix with agent prompt
Summary
Updates the font removal command and its menu text.
Reviews (5) · Last reviewed commit: "Rename font removal menu entry" · Reviewed by Greptile