Skip to content

Restore leftover app-menu icons after the Quattro upgrade - #6972

Open
calledtoconstruct wants to merge 14 commits into
omacom:quattrofrom
calledtoconstruct:fix-6883-quattro-app-menu-icons
Open

calledtoconstruct wants to merge 14 commits into
omacom:quattrofrom
calledtoconstruct:fix-6883-quattro-app-menu-icons

Conversation

@calledtoconstruct

Copy link
Copy Markdown

Fixes #6883.

The Quattro upgrade moved stock PNGs out of ~/.local/share/applications/icons/ and copied Alacritty.desktop even when Alacritty was not installed. Leftover custom launchers (ChatGPT, GitHub, windows-vm, …) still pointed at the old absolute Icon= paths, so the Apps menu showed generic/missing icons.

  • Future upgrades: copy packaged launchers first, leave any still-referenced PNG in place, copy Alacritty only if alacritty is on PATH.
  • Already-upgraded machines: new migration restores those PNGs from icons.omarchy-upgrade-to-quattro.*.bak and removes a ghost Alacritty launcher.
  • omarchy-refresh-applications does the same repair.

Verified on an upgraded 4.0.0 laptop: ChatGPT/GitHub icons were missing, then present after the migration.

Copilot AI balanced review requested due to automatic review settings August 15, 2026 13:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-quattro to 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.

Comment thread migrations/1786790068.sh Resolved
Copilot AI review requested due to automatic review settings August 15, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 pipefail if 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 | cut pipelines are used in command substitutions and can cause the test to exit early (before your explicit fail ... message) when grep finds 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 || true to 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"

Comment thread migrations/1788173342.sh Resolved
Copilot AI review requested due to automatic review settings August 15, 2026 13:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/bash shebang (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 < 5 threshold 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 the cp occurs within the if command -v alacritty …; then … fi block using a bounded range search via awk/sed, or by locating the fi line and checking guard < copy < fi).
(( alacritty_copy - alacritty_guard < 5 )) ||

Comment thread test/shell.d/upgrade-to-quattro-test.sh Resolved
Copilot AI review requested due to automatic review settings August 15, 2026 13:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_line is derived from the first occurrence of legacy_desktop_names_icon, which will typically be the function definition (not the icon-moving mv loop). This can make the ordering assertion pass even if the actual icon move happens earlier/later than intended. Consider keying icon_move_line off a unique marker for the move operation (e.g., the mv -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 without set -euo pipefail, partial failures (e.g., copy errors) can be silently ignored. Add a bash shebang (e.g., #!/usr/bin/env bash) and set -euo pipefail at 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

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed against quattro (merge base b724f76). I simulated the upgrade block and the migration end to end against throwaway homes on a disposable VM; both new test files pass, and test/shell.d/upgrade-to-quattro-test.sh passes in full.

What I confirmed works:

  • Copying the packaged launchers before the icon move does the right thing. Starting from a 3.x home with GitHub, windows-vm, ChatGPT, Docker and Zoom launchers all naming absolute paths under ~/.local/share/applications/icons/: Docker.desktop and Zoom.desktop get replaced by the packaged entries (Icon=docker, Icon=zoom) and their PNGs move to the backup, while GitHub.png, ChatGPT.png, windows.png and Retro Gaming.png stay in place and keep resolving.
  • Re-running that block three times with different BACKUP_SUFFIX values is stable: no extra .bak directories accumulate, nothing regresses.
  • The migration is idempotent across two runs, does not overwrite an icon already in place, handles icon names containing spaces, entries with no Icon=, and entries with a second Icon= in a [Desktop Action] group, all without aborting under bash -euo pipefail (which is how omarchy-migrate invokes it).

Three things worth tightening:

  1. migrations/1786790068.sh:30 removes ~/.local/share/applications/Alacritty.desktop on any machine where alacritty is off PATH, without checking the file is the one the upgrade installed. On an upgraded machine that is fine — the upgrade rm -fs that name first and then re-copies the stock file. But the migration also runs on 4.x installs that never ran the Quattro upgrade, and there a hand-written Alacritty.desktop pointing at a Flatpak, a wrapper or an SSH command would be deleted. Gating the removal on the file matching $OMARCHY_PATH/default/alacritty/Alacritty.desktop, or on it carrying TryExec=alacritty, keeps the ghost-launcher fix without that risk.

  2. migrations/1786790068.sh:19-23: [[ -e $icon ]] is false for a dangling symlink, and GNU cp then refuses with cp: not writing through dangling symlink and exits 1. Under bash -euo pipefail that aborts the whole migration, so any launcher later in the loop goes unrepaired and the completion marker is never written — it then retries and fails again at every login. [[ -e $icon || -L $icon ]] && continue covers it.

  3. test/shell.d/upgrade-to-quattro-test.sh:142: icon_move_line matches the definition of legacy_desktop_names_icon (line 2165 of the script), not its call in the move condition (line 2200). The ordering assertion therefore still holds if the helper were never called, so it does not prove what its pass string claims; matching the if [[ -e $legacy_icons_dir/$icon ]] && ! legacy_desktop_names_icon line instead would. The (( alacritty_copy - alacritty_guard < 5 )) proximity check on line 155 will also trip on an innocent reformat of that condition.

One note for whoever merges. #6884 attacks the same breakage from dev by rewriting the orphaned Icon= paths to theme names instead of keeping the PNGs. The two do not fully overlap: there is no github.png under /usr/share/icons/hicolor/*/apps/ (applications/icons/ ships no GitHub.png), so a rewrite to Icon=github leaves the exact launcher named in #6883 without an icon, whereas leaving the PNG in place does not. #6884 also has no migration, so it does nothing for machines that have already upgraded. Which approach lands is the maintainer's call.

Copilot AI review requested due to automatic review settings August 18, 2026 09:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_line can 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 constraining icon_move_line to 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 the find grep) 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"

@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at 996e853f. The only thing you pushed since the last look was 85c43abe, a merge of upstream quattro with no code of your own, so this pass is about what the merge did — plus findings from a review in between that never made it onto this thread.

The merge is clean. The branch's own delta against the new base (b686ed89) is byte-for-byte identical to what it was against the old one (b724f761): same four files, same +202/-8. Nothing dropped, nothing duplicated, no upstream work reverted — git merge-base origin/quattro HEAD is the quattro tip itself. Upstream's hunks in bin/omarchy-upgrade-to-quattro (lines 597, 1187, 1312, 1350, 1382, 1392, 2306, 2340) are disjoint from yours (2183-2238), so there is no semantic conflict: legacy_desktop_names_icon appears exactly twice, one definition and one call; the packaged-launcher copy and the Alacritty copy appear once each; and no top-level exit in the USER_SETUP heredoc sits between the packaged copy and the icon-parking loop. The reorder itself is right, and the command -v alacritty guard is the same check bin/omarchy-refresh-applications:9 already makes.

What the merge did change is the cost of a migration that dies. Upstream rewrote run_post_upgrade_migrations (bin/omarchy-upgrade-to-quattro:1192-1206): a migration that exits non-zero, or leaves anything pending, now fails the whole Quattro upgrade 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. All three reproduce on a disposable VM:

  • An unreadable .desktop anywhere in ~/.local/share/applications makes sed exit non-zero inside the command substitution. EXIT=2, and every launcher after it in the loop goes unrepaired.
  • A dangling ~/.local/share/applications/icons symlink is neither -e nor -L at the leaf, so the run gets past your guard and reaches mkdir -p, which exits 1 on a dangling symlink rather than following it. EXIT=1.
  • A launcher with enough Icon= lines to fill the pipe buffer gives head the chance to close it first, and sed takes SIGPIPE. EXIT=141. Contrived on its own, but it is the same pipefail exposure as the first one.

Pushed two commits.

d87057b1 renumbers the migration to migrations/1788173342.sh. #6963 adds migrations/1786790068.sh too, with unrelated Ghostty content, because omarchy-dev-add-migration names a migration after the commit date of the tip it is run against and b724f761 was the merge base for both branches. The 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 is the only resolution that reaches users who already migrated.

996e853f fixes the three abort paths above and one more: the backup glob expands in ascending timestamp order, so breaking on the first match restored the oldest parked copy on a home that survived two upgrade attempts. It now keeps the last match. Reading the first Icon= with sed alone also drops the head(1) that could take SIGPIPE. Three assertions went into test/shell.d/quattro-application-launchers-test.sh; each one was checked by mutation, so reverting the corresponding fix turns it red (7/9 exit 1, 8/9 with not ok - migration restores from the newest upgrade backup, and the unreadable case aborts the file outright).

Two things left, both yours or the maintainer's rather than mine.

The TryExec=alacritty discriminator still deletes a hand-written Alacritty.desktop derived from the stock file. Somebody who copied the stock launcher and changed only Exec= to a Flatpak, a wrapper or an SSH command keeps the stock TryExec=alacritty line, and loses the file when alacritty is off PATH. How aggressive that removal should be is a product call, so I have not touched it — but the fixture behind "keeps a custom Alacritty.desktop when alacritty is missing" writes no Exec, no TryExec and no Type, so it passes without ever reaching the predicate it is named after. A fixture that is the stock file with Exec= rewritten would exercise it (test/shell.d/quattro-application-launchers-test.sh:80-85). Worth noting that on a machine that actually ran the upgrade this is narrower than it reads: the rm -f loop at bin/omarchy-upgrade-to-quattro:2169-2181 already removed that filename unconditionally, so the population at risk is 4.x installs that never upgraded.

test/shell.d/upgrade-to-quattro-test.sh still carries a 100644 to 100755 mode change that has nothing to do with the fix. test/shell.d/ is split roughly evenly between the two modes so nothing enforces either, but it is a line of diff that will outlive its explanation.

Separately, and not something this PR can fix: bin/omarchy-upgrade-to-quattro on dev and master still has the old ordering, with the packaged-launcher copy after the icon move and the Alacritty copy ungated. Whoever merges this will want the forward-port, or 3.8.x-to-4 upgrades keep breaking icons the same way.

What was checked. All of it ran on a disposable VM, never on the machine doing the review: test/shell.d/quattro-application-launchers-test.sh (9 passed), test/shell.d/upgrade-to-quattro-test.sh (25 passed), migrate-scope-test.sh, migrate-wrapper-test.sh, bin-style-test.sh, and ./test/cli, all green against 996e853f. The three abort paths and the oldest-backup behaviour were reproduced directly against throwaway homes before being fixed, and the fixes proven by mutation rather than by the tests merely passing.

Who checked this. The review above is Claude Opus 5, with Codex at xhigh reasoning as a second reader on the tree pinned to 85c43abe. The unreadable-.desktop abort, the dangling icons directory symlink, and the oldest-backup ordering are all its findings, not mine — I had reasoned about the sed | head pipeline and wrongly dismissed it, and had not considered a dangling parent directory or a second backup at all. It agreed with the merge analysis and the ordering analysis that were already written down, and independence there is not currently guaranteed. One claim of its own did not hold: it read quattro-application-launchers-test.sh:104 as letting a parent-path traversal through, but line 103 is the assertion that catches it.

Waiting on the maintainer for the dev/master forward-port and for the call on how hard to hunt a ghost Alacritty launcher; waiting on you for the fixture, if you agree it is worth tightening.

@calledtoconstruct

Copy link
Copy Markdown
Author

8c929f07 changes ghost Alacritty removal to cmp -s against the shipped $OMARCHY_PATH/default/alacritty/Alacritty.desktop. An unmodified upgrade-installed copy is still removed when alacritty is off PATH. The custom fixture is now that stock file with only Exec= rewritten, and it is kept. A launcher that still has TryExec=alacritty but differs in any other field is also kept.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Sep 28, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at 4b54db42, against quattro (merge base b686ed89). Both things left open last time are resolved by 8c929f07 and 959ce10c.

  • Ghost Alacritty launcher. The removal now needs cmp -s against $OMARCHY_PATH/default/alacritty/Alacritty.desktop. That file has not changed on quattro since before 4.0.0, so a launcher the upgrade copied still matches it and goes. A stock copy with only Exec= rewritten is kept, and the fixture now exercises exactly that case. omarchy-migrate passes OMARCHY_PATH to every migration, so the new reference is safe under set -u.
  • Test file mode. test/shell.d/upgrade-to-quattro-test.sh is back to 100644, so the diff no longer carries an unrelated mode change.

Pushed one commit. In 4b54db42, the dangling-symlink case in test/shell.d/quattro-application-launchers-test.sh restored ChatGPT.desktop as its "later launcher". The glob visits that file before GitHub.desktop, so the assertion passed even if the loop stopped at the symlink. The fixture is now WhatsApp.desktop, which sorts after it. To prove it, I changed && continue to && break at migrations/1788173342.sh:23. The new test fails with that change, and the old one still passed.

What ran. Everything ran on a disposable VM, never on the reviewing machine:

  • A simulated upgraded home with alacritty off PATH. With the fix reverted, GitHub.png stayed missing and the stock Alacritty.desktop stayed. At this head, the newest of two backups was restored, the stock launcher was removed, a Flatpak-edited one was kept, and a second run changed nothing. It behaves the same on this branch merged onto the current quattro tip, which merges without conflict.
  • Test suites, all green: ./test/cli (116), quattro-application-launchers-test.sh (9), upgrade-to-quattro-test.sh (25), migrate-scope-test.sh, migrate-wrapper-test.sh and bin-style-test.sh.

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 4b54db42, came back clean. It agreed with the rest of the analysis, including the view that a migration is the only way to repair machines that have already upgraded. Its independence is not guaranteed. It also pointed out that the upgrade-to-quattro-test.sh assertions check the script's structure rather than running the upgrade block. That is a limit on coverage, not a defect, and the block itself was run end to end in the earlier review.

Nothing is left for you. This now waits on the maintainer, as does the forward-port of the upgrade-script reordering to dev and master mentioned earlier. #6884 is still open against dev and covers part of that.

@omarchybot omarchybot added ready Good to merge and removed ready Good to merge labels Sep 28, 2026
calledtoconstruct and others added 5 commits September 30, 2026 09:40
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.
omarchybot and others added 5 commits September 30, 2026 09:40
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>
@calledtoconstruct
calledtoconstruct force-pushed the fix-6883-quattro-app-menu-icons branch from 4b54db4 to fbf201c Compare September 30, 2026 13:41
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the remaining test-coverage suggestion is non-blocking.

Findings

  1. P2 Icon preservation remains untested ▶

Summary

Restores icons used by launchers left over from the Quattro upgrade.

  • The Quattro upgrade keeps PNGs that installed launchers still name.
  • Application refresh restores icons that older launchers still name.
  • Alacritty's launcher appears only when the app is installed.

Reviews (4) · Last reviewed commit: "Test the icon restore through refresh-ap..." · Reviewed by Greptile

Comment thread migrations/1788173342.sh Resolved
Comment thread test/shell.d/upgrade-to-quattro-test.sh Outdated
Comment on lines +248 to +253
# 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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@omarchybot omarchybot removed verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Sep 30, 2026
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.
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Sep 30, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at cdae6b2f, against quattro (merge base 8b4eae66). The first ten commits are the ones reviewed last time, rebased with no changes (git range-diff shows each one as identical). So this pass covers only cdae6b2f, which moves the restore loop into install/helpers/quattro-app-icons.sh and also calls it from omarchy-refresh-applications.

No defects found in the new commit.

  • The migration still behaves the same. The loop is unchanged apart from moving into the helper and restored becoming quattro_icons_restored, and the helper returns 0, so it still cannot abort omarchy-migrate on the cases fixed earlier (an unreadable launcher, a dangling symlink, a dangling icons/ directory).
  • Adding it to refresh is proportionate. omarchy-upgrade-to-quattro tells the user to rerun omarchy refresh applications when its own refresh fails. Refresh copies the packaged launchers first, so their theme-name Icon= lines never pull a PNG back. The other callers (omarchy-provision-user, omarchy-install-preinstalls, migration 1786183928) have no Quattro backup directories to restore from, so for them the helper does nothing. The helper sits beside browser-policy.sh, which is sourced from $OMARCHY_PATH/install/helpers/ in the same way, and nothing sources that directory wholesale.

What ran. Everything ran on a disposable VM, never on the reviewing machine:

  • A simulated upgraded home: GitHub.desktop and ChatGPT.desktop pointing at icons/, with the PNGs in two upgrade backups. omarchy-refresh-applications from quattro, and from this head with the new refresh call removed, left both icons missing. At this head it restored both, took GitHub.png from the newer backup, and changed nothing on a second run. With the refresh call removed, the new test at the end of quattro-application-launchers-test.sh fails, so it tests what its name claims.
  • Shell tests, all green: quattro-application-launchers-test.sh (10), upgrade-to-quattro-test.sh (26), migrate-scope-test.sh, migrate-wrapper-test.sh and bin-style-test.sh.
  • ./test/cli has one failure: vscode generated theme references current theme file (test/cli:607). It fails identically on quattro at 8b4eae66 without this branch, so this pull request did not cause it. The full suite is still not green, though, and that is the one thing keeping this from being marked ready.

Who checked this. I am Claude Opus 5.5, and Codex at medium effort gave a second opinion on cdae6b2f. It found no defects and agreed that the refactor preserves behaviour, that refresh is safe for every caller, and that the new test exercises the refresh path. Its independence is not guaranteed. It read the code and ran nothing.

Nothing is left for you. This waits on the maintainer, and on quattro's own ./test/cli failure being fixed. The earlier note still stands: the upgrade-script reordering needs forward-porting to dev and master.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 18, 2026
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>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 18, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This branch had stopped merging cleanly into quattro, so I merged quattro (da2db1a2) into it as 35473955. Your commits are unchanged.

The conflict. Only bin/omarchy-refresh-applications conflicted. #9596 removed the block that ran install/user/mise.sh, and this branch adds the icon restore right above that block. The merge keeps the restore and drops the mise.sh call, as quattro intends. That made one test comment wrong, so I changed it too: quattro-application-launchers-test.sh said its fixture tree kept mise.sh from running, and refresh no longer runs it. Nothing else changed. omarchy-upgrade-to-quattro and its test merged without conflicts and still match quattro's code. Nothing on quattro since 8b4eae66 already restores these icons.

What ran. Everything ran against 35473955 on a disposable VM, never on the reviewing machine:

  • A simulated upgraded home, with leftover custom launchers that point at icons/GitHub.png and icons/ChatGPT.png and the PNGs in an upgrade backup. omarchy-refresh-applications from quattro, and from this head with the fix taken out, left both icons missing. At this head, refresh and migration 1788173342 each restored both, and running either again was a no-op.
  • quattro-application-launchers-test.sh (10), upgrade-to-quattro-test.sh (32), mise-lazy-tools-migration-test.sh, migrate-scope-test.sh, renumbered-background-migration-test.sh and launcher-remove-test.sh all pass.
  • ./test/cli is now fully green. The vscode generated theme failure noted last time is fixed on quattro.

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 quattro's #9596 change. It also confirmed that omarchy-migrate still runs 1788173342 even though its timestamp is older than quattro's newest migrations, because each migration is checked against its own completion marker. That independence is not guaranteed. Codex read the code and ran nothing.

The pull request is marked verified again. Nothing is left for you. It waits on CI reporting on the new head, and then on the maintainer.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
omarchybot and others added 2 commits October 31, 2026 20:29
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>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This branch had stopped merging into quattro again, so I merged quattro (e4fffc6e) into it and adjusted the tests to two rules quattro gained since. Your fix itself is unchanged.

What I pushed.

  • c7aa9ff4 merges quattro. Only test/shell.d/upgrade-to-quattro-test.sh conflicted: Remove tests that only read source text #16334 removed the tests that read a script's source text, and this branch's check of line order in omarchy-upgrade-to-quattro was one of them, so that file is now exactly as quattro has it.
  • 263d024c trims test/shell.d/quattro-application-launchers-test.sh to the omarchy-refresh-applications case. Remove migration tests #16302 removed migration tests (a migration runs once and is frozen once it ships), and the restore logic in install/helpers/quattro-app-icons.sh is still covered through refresh, which sources it. The refresh run now also has the checkout's own bin/ on PATH, as preinstalls-test.sh does.

What ran. Everything ran on a disposable VM, never on the reviewing machine:

  • The launcher test fails on quattro and on this head with the refresh hunk taken out, and passes at 263d024c.
  • The upgrade's launcher and legacy-icon block, run against a simulated 3.x home with leftover GitHub and ChatGPT launchers pointing into icons/ and no alacritty installed: on quattro both PNGs are parked in the backup and a stock Alacritty.desktop is installed anyway; at this head both PNGs stay where the launchers point, stock icons such as HEY's are still parked, and no Alacritty.desktop appears.
  • Migration 1788173342 on an already-upgraded home restores both PNGs from the backup and removes the stock Alacritty.desktop; running it again is a no-op.
  • quattro-application-launchers, upgrade-to-quattro, preinstalls, migrate-scope, migrate-notify, bin-style, config, unowned-system-paths and update-sequence tests, and ./test/cli, all pass.

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: omarchy-migrate runs every migration without a marker, in name order, so it still runs on machines that have completed later ones. muse-wonder suggested letting a failed icon copy in the helper be skipped; I left it, because quattro's migration guide wants a migration that cannot finish to stay pending rather than be marked done, and Codex agreed.

Competing fix. #6884 is older and fixes the same bug by rewriting the dead Icon= paths to theme names. Asked which should go forward, without my answer, both reviewers picked this one: #6884 does not guard the Alacritty.desktop copy and has nothing for machines that already upgraded. Its rewrite to theme names is a different approach the maintainer may still prefer.

What it waits on. Nothing is left for you. It waits on the maintainer, who has a couple of design choices to make: whether omarchy-refresh-applications should carry this one-time Quattro repair permanently, and whether the restore belongs in install/helpers/ or in a bin/ command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quattro upgrade leaves broken app-menu icons and a ghost Alacritty launcher

4 participants