Skip to content

Fix font removal menu behavior - #1

Merged
itscallssh merged 10 commits into
add-fonts-remove-menufrom
itscallssh-fix-font-removal-pr
Oct 22, 2026
Merged

itscallssh merged 10 commits into
add-fonts-remove-menufrom
itscallssh-fix-font-removal-pr

Conversation

@itscallssh

@itscallssh itscallssh commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

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-i18n for picker and notification text, and the displayed font-family/package mapping excludes the active package from both the picker and --list. Removal delegates to omarchy-pkg-drop, and the command now has explicit CLI summary metadata.

Validation was not run in this session.

RetriggerView in GreptileConfidence Score: 4/5

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 All in CursorFindings

  1. P1 Unknown names remove installed fonts ▶
  2. P2 Font errors stay in English ▶
  3. P2 Test misses the original bug ▶
  4. P2 Tests change host font caches ▶
Fix with agent prompt
### Issue 1
bin/omarchy-font-remove:364
`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.

### Issue 2
bin/omarchy-font-remove:74-78
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.

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!

### Issue 3
test/shell.d/font-remove-test.sh:undefined-72
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.

### Issue 4
test/shell.d/font-remove-test.sh:100-102
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.

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!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Updates the font removal command and its menu text.

  • The picker marks the active font, and the command keeps it protected.
  • Font removal uses Omarchy’s package command and translated messages.
  • The Remove menu names its font option “Font.”

Reviews (5) · Last reviewed commit: "Rename font removal menu entry" · Reviewed by Greptile

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread bin/omarchy-font-remove Resolved
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

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.

Fix in Cursor

greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 22, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@greptile-apps
greptile-apps Bot dismissed their stale review October 22, 2026 10:24

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>
greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 22, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@greptile-apps
greptile-apps Bot dismissed their stale review October 22, 2026 10:33

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

itscallssh and others added 2 commits October 22, 2026 14:05
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment on lines +100 to +102
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 ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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)

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!

Fix in Cursor

itscallssh and others added 3 commits October 22, 2026 14:24
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>
Comment thread bin/omarchy-font-remove
[[ -n $candidate ]] || continue
tries+=("$candidate")
# The menu marks the active font "Family (active)"; also try without it.
[[ $candidate == *" ("*")" ]] && tries+=("${candidate% (*)}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Fix in Cursor

Comment thread bin/omarchy-font-remove
Comment on lines +74 to +78
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:-}" ;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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)

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!

Fix in Cursor

@itscallssh
itscallssh merged commit c7f4409 into add-fonts-remove-menu Oct 22, 2026
1 of 2 checks passed
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