Repository navigation
Restore leftover app-menu icons after the Quattro upgrade - #6972
calledtoconstruct wants to merge 14 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds safeguards and remediation around Quattro application launcher/icon handling, preventing broken icons for surviving custom launchers and avoiding installation of an Alacritty launcher when Alacritty isn’t present.
Changes:
- Reorders
omarchy-upgrade-to-quattroto copy packaged launchers before moving legacy PNG icons; adds an Alacritty presence guard. - Introduces a migration to restore referenced legacy icons from Quattro backups and remove a “ghost” Alacritty launcher.
- Adds/extends shell tests covering the migration and ordering/guard behavior.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/shell.d/upgrade-to-quattro-test.sh | Adds assertions for launcher-copy ordering and Alacritty guard in the upgrade script. |
| test/shell.d/quattro-application-launchers-test.sh | New end-to-end shell tests for icon restore + ghost Alacritty removal on migration/refresh. |
| migrations/1786790068.sh | New migration to restore referenced icons from backup and remove Alacritty.desktop when missing. |
| bin/omarchy-upgrade-to-quattro | Copies packaged launchers earlier; skips moving still-referenced icons; guards Alacritty launcher install. |
| bin/omarchy-refresh-applications | Restores referenced icons from backup; removes Alacritty.desktop when Alacritty missing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
migrations/1786790068.sh:1
- This new migration script has no shebang and no explicit shell mode. If it’s ever executed directly (rather than invoked as
bash ...), it may run under an unexpected shell. Add a bash shebang at the top (and align error handling with other migrations, e.g.,set -euo pipefailif that’s the project convention) to make execution predictable.
echo "Restore app-menu icons the Quattro upgrade moved out from under surviving launchers"
test/shell.d/upgrade-to-quattro-test.sh:144
- These
grep | head | cutpipelines are used in command substitutions and can cause the test to exit early (before your explicitfail ...message) whengrepfinds no match, depending on the test harness’ shell settings. Consider guarding the pipelines so they reliably produce an empty string on “not found” (e.g., append|| trueto the pipeline) and let the explicit[[ -n ... ]] || fail ...checks control the failure message.
packaged_apps_line=$(grep -n 'find "$root/applications"' "$upgrade_to_quattro" | head -1 | cut -d: -f1)
icon_move_line=$(grep -n 'legacy_desktop_names_icon' "$upgrade_to_quattro" | head -1 | cut -d: -f1)
[[ -n $packaged_apps_line && -n $icon_move_line ]] ||
fail "upgrade copies packaged launchers before moving leftover icons"
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
migrations/1786790068.sh:1
- This migration script has no shebang; if the migration runner executes it directly (instead of
bash migrations/…), it may fail with an exec format error or run under an unexpected shell. Add a#!/bin/bashshebang (and, if consistent with other migrations,set -euo pipefail) so runtime behavior is deterministic.
echo "Restore app-menu icons the Quattro upgrade moved out from under surviving launchers"
test/shell.d/upgrade-to-quattro-test.sh:155
- The
< 5threshold is a brittle, magic-number coupling to the script’s formatting rather than the behavior being tested; small refactors/added comments could break the test without changing semantics. Consider asserting structure more directly (e.g., that thecpoccurs within theif command -v alacritty …; then … fiblock using a bounded range search viaawk/sed, or by locating thefiline and checking guard < copy < fi).
(( alacritty_copy - alacritty_guard < 5 )) ||
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (2)
test/shell.d/upgrade-to-quattro-test.sh:146
icon_move_lineis derived from the first occurrence oflegacy_desktop_names_icon, which will typically be the function definition (not the icon-movingmvloop). This can make the ordering assertion pass even if the actual icon move happens earlier/later than intended. Consider keyingicon_move_lineoff a unique marker for the move operation (e.g., themv -f \"$legacy_icons_dir/$icon\"line or the start of the legacy icons loop) so the test validates the real ordering.
packaged_apps_line=$(grep -n -F 'find "$root/applications"' "$upgrade_to_quattro" | head -1 | cut -d: -f1)
icon_move_line=$(grep -n 'legacy_desktop_names_icon' "$upgrade_to_quattro" | head -1 | cut -d: -f1)
[[ -n $packaged_apps_line && -n $icon_move_line ]] ||
fail "upgrade copies packaged launchers before moving leftover icons"
(( packaged_apps_line < icon_move_line )) ||
fail "upgrade copies packaged launchers before moving leftover icons"
migrations/1786790068.sh:3
- This migration script has no shebang and doesn’t enable strict mode. If the migration runner executes files directly (rather than invoking
bash <file>), the lack of a shebang can fail at runtime; and withoutset -euo pipefail, partial failures (e.g., copy errors) can be silently ignored. Add a bash shebang (e.g.,#!/usr/bin/env bash) andset -euo pipefailat the top to make execution mode explicit and failure behavior consistent.
echo "Restore app-menu icons the Quattro upgrade moved out from under surviving launchers"
# The upgrade used to park every stock PNG under
|
Reviewed against What I confirmed works:
Three things worth tightening:
One note for whoever merges. #6884 attacks the same breakage from |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (4)
test/shell.d/upgrade-to-quattro-test.sh:142
icon_move_linecan contain multiple line numbers if the grep matches more than once, which will break the arithmetic comparison(( packaged_apps_line < icon_move_line ))(or make it behave unpredictably). Fix by constrainingicon_move_lineto a single match (e.g.,head -1) or otherwise asserting uniqueness before comparing.
packaged_apps_line=$(grep -n -F 'find "$root/applications"' "$upgrade_to_quattro" | head -1 | cut -d: -f1)
icon_move_line=$(grep -n -F 'if [[ -e $legacy_icons_dir/$icon ]] && ! legacy_desktop_names_icon' "$upgrade_to_quattro" | cut -d: -f1)
[[ -n $packaged_apps_line && -n $icon_move_line ]] ||
fail "upgrade copies packaged launchers before moving leftover icons"
(( packaged_apps_line < icon_move_line )) ||
test/shell.d/upgrade-to-quattro-test.sh:142
- These assertions are tightly coupled to exact string fragments in the upgrade script, which makes the test brittle (small refactors or whitespace changes can cause false failures). Consider matching more specific/structural markers (e.g., a unique function name or a distinctive comment tag), or matching a slightly broader but unique pattern (such as including
-maxdepth 1 -type f -name '*.desktop'in thefindgrep) to reduce accidental matches and future churn.
packaged_apps_line=$(grep -n -F 'find "$root/applications"' "$upgrade_to_quattro" | head -1 | cut -d: -f1)
icon_move_line=$(grep -n -F 'if [[ -e $legacy_icons_dir/$icon ]] && ! legacy_desktop_names_icon' "$upgrade_to_quattro" | cut -d: -f1)
migrations/1786790068.sh:1
- This migration script has no shebang. If migrations are ever executed directly (instead of via
bash ... script.sh), the shell used may differ and break the bash-specific syntax ([[ ... ]],(( ... ))). Add an explicit#!/bin/bash(or the repo’s standard shell) at the top to make execution consistent.
echo "Restore app-menu icons the Quattro upgrade moved out from under surviving launchers"
test/shell.d/quattro-application-launchers-test.sh:117
- The second assertion is effectively redundant given the first: if the migration replaced the symlink with a real file, line 116 would already fail. Also, the failure text on line 117 is a bit confusing (it sounds like replacement is desired). Consider removing line 117, or replacing it with a check that directly asserts the symlink was not replaced (e.g., assert it remains a symlink and still dangles).
[[ -L $icons/GitHub.png ]] || fail "migration leaves a dangling icon symlink in place"
[[ ! -e $icons/GitHub.png ]] || fail "migration does not replace a dangling icon symlink"
|
Re-reviewed at The merge is clean. The branch's own delta against the new base ( What the merge did change is the cost of a migration that dies. Upstream rewrote
Pushed two commits.
Two things left, both yours or the maintainer's rather than mine. The
Separately, and not something this PR can fix: What was checked. All of it ran on a disposable VM, never on the machine doing the review: Who checked this. The review above is Claude Opus 5, with Codex at xhigh reasoning as a second reader on the tree pinned to Waiting on the maintainer for the |
|
|
|
Re-reviewed at
Pushed one commit. In What ran. Everything ran on a disposable VM, never on the reviewing machine:
Who checked this. I am Claude Opus 5.5, and Codex at medium effort gave a second opinion over two rounds. It found the fixture ordering fixed above, and its last round, on Nothing is left for you. This now waits on the maintainer, as does the forward-port of the upgrade-script reordering to |
The upgrade parked stock launcher PNGs and always installed Alacritty.desktop, which left dangling Icon= paths and a ghost Alacritty entry. Keep referenced icons, skip Alacritty when it is not installed, and repair already-upgraded homes. Closes omacom#6883
Refresh does not need a second copy of the icon restore, and Alacritty.desktop is only removed when alacritty is missing.
A prefix match on Icon= would follow .. out of that directory.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Only remove Alacritty.desktop when it carries TryExec=alacritty, and treat a dangling Icon= symlink as already present so cp cannot abort the loop. The upgrade test now matches the icon-move call site rather than the helper definition.
omarchy-dev-add-migration names a migration after the commit date of the tip it is run against, so two contributors branching from the same commit get the same filename. b724f76 was the merge base for both this branch and omacom#6963, and both ended up adding migrations/1786790068.sh with unrelated contents. A filename collision is worse than the add/add conflict it looks like. omarchy-migrate keys its completion marker on the filename alone, so once either version has run on a machine, that machine skips the other for good -- even if the conflict is resolved by keeping both bodies in one file. Renumbering off the shared name is the only resolution that reaches users who already migrated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Upstream now treats an incomplete migration as fatal: run_post_upgrade_migrations fails the upgrade when omarchy-migrate exits non-zero or leaves anything pending, where it used to warn and carry on. Under bash -euo pipefail this migration had three ways to exit non-zero on a real home, and each one now costs a half-upgraded machine rather than one unrepaired icon. An unreadable .desktop made sed exit non-zero inside the command substitution; a dangling ~/.local/share/applications/icons symlink is neither -e nor -L at the leaf, so the run reached mkdir -p, which exits 1 on a dangling symlink rather than following it. Reading the first Icon= with sed alone also removes the head(1) that could take SIGPIPE on a pathological launcher. Restoring from the newest backup rather than the first is the same loop read the other way round. The glob expands in ascending timestamp order, so breaking on the first match picked the oldest parked copy on a home that survived two upgrade attempts. Co-Authored-By: Codex XHigh <noreply@openai.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The healthy fixture was ChatGPT.desktop, which the glob visits before GitHub.desktop, so "still restores later launchers" passed even if the loop stopped at the dangling symlink. WhatsApp.desktop sorts after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
4b54db4 to
fbf201c
Compare
[Medium impact] The PR appears safe to merge; the remaining test-coverage suggestion is non-blocking. Findings
SummaryRestores icons used by launchers left over from the Quattro upgrade.
Reviews (4) · Last reviewed commit: "Test the icon restore through refresh-ap..." · Reviewed by Greptile |
| # matching PNGs move, so a leftover custom launcher that still names one of | ||
| # those files keeps a working icon instead of a dangling path. | ||
| packaged_apps_line=$(grep -n -F 'find "$root/applications"' "$upgrade_to_quattro" | head -1 | cut -d: -f1) | ||
| icon_move_line=$(grep -n -F 'if [[ -e $legacy_icons_dir/$icon ]] && ! legacy_desktop_names_icon' "$upgrade_to_quattro" | cut -d: -f1) | ||
| [[ -n $packaged_apps_line && -n $icon_move_line ]] || | ||
| fail "upgrade copies packaged launchers before moving leftover icons" |
There was a problem hiding this comment.
Icon preservation remains untested
These assertions check only that the launcher copy appears before the icon-moving condition in the script text. They would still pass if the reference check always returned false and the upgrade moved every referenced PNG. A behavioral upgrade test with a leftover launcher and icon would catch that regression; the new behavioral tests cover only the migration.
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!
omarchy-refresh-applications is what the upgrade tells a user to rerun, and it only recopied launchers. Share the migration's restore so a leftover launcher gets the same PNG back without replaying other migrations.
|
Re-reviewed at No defects found in the new commit.
What ran. Everything ran on a disposable VM, never on the reviewing machine:
Who checked this. I am Claude Opus 5.5, and Codex at medium effort gave a second opinion on Nothing is left for you. This waits on the maintainer, and on |
quattro dropped the mise.sh call from omarchy-refresh-applications (omacom#9596), at the spot where this branch adds the icon restore. Keep the restore, drop the mise.sh call, and correct the launcher test's comment, which said its fixture tree kept mise.sh from running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch had stopped merging cleanly into The conflict. Only What ran. Everything ran against
Who checked this. I am Claude Opus 5.5. Codex at medium effort gave a second opinion on the merge and found no defects. It agreed that the resolution keeps The pull request is marked |
The only conflict was test/shell.d/upgrade-to-quattro-test.sh, where omacom#16334 removed the tests that read the upgrade script's source text. The branch's ordering and Alacritty-guard checks were that kind of test, so the file is taken as quattro has it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omacom#16302 removed migration tests from the suite: a migration runs once and is frozen once it ships. The restore logic lives in install/helpers/quattro-app-icons.sh, which omarchy-refresh-applications sources, so the refresh case keeps covering it, with the repository's own helpers on PATH as its peer tests have them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: muse-wonder via pi, thinking high <noreply@omacom.io>
|
This branch had stopped merging into What I pushed.
What ran. Everything ran on a disposable VM, never on the reviewing machine:
Second opinion. Codex Medium and muse-wonder (via pi, thinking high) reviewed the merge, the test changes and the whole diff over two rounds and found no defects; they agree with the above, and their independence from my reasoning is not guaranteed. Both checked that the migration's older number is fine: Competing fix. #6884 is older and fixes the same bug by rewriting the dead What it waits on. Nothing is left for you. It waits on the maintainer, who has a couple of design choices to make: whether |
Fixes #6883.
The Quattro upgrade moved stock PNGs out of
~/.local/share/applications/icons/and copiedAlacritty.desktopeven when Alacritty was not installed. Leftover custom launchers (ChatGPT, GitHub, windows-vm, …) still pointed at the old absoluteIcon=paths, so the Apps menu showed generic/missing icons.alacrittyis on PATH.icons.omarchy-upgrade-to-quattro.*.bakand removes a ghost Alacritty launcher.omarchy-refresh-applicationsdoes the same repair.Verified on an upgraded 4.0.0 laptop: ChatGPT/GitHub icons were missing, then present after the migration.