feat(theme-check-vscode): surface orphaned files on startup#1218
Open
ryandiginomad wants to merge 1 commit into
Open
feat(theme-check-vscode): surface orphaned files on startup#1218ryandiginomad wants to merge 1 commit into
ryandiginomad wants to merge 1 commit into
Conversation
On activation, check the theme for orphaned (dead) files and show a single dismissable notification with "Review" (opens the existing dead-code picker) and "Don't show again" actions, instead of requiring the user to run the dead-code command manually. - Gated by a new `themeCheck.checkOrphanedFilesOnBoot` setting (default on), mirroring the existing `themeCheck.preloadOnBoot` pattern - Reuses the whole-theme dead-code detection already exposed via ThemeGraphDeadCodeRequest - Extract fetchDeadCode + showDeadCodePicker from makeDeadCode so the startup check and the command share logic (no behavior change; covered by tests) - Wired into both node and browser activation, fire-and-forget so it never blocks or fails activation Closes Shopify#970
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.
What
Closes #970.
theme-graph already knows which files are orphaned (dead code), and there's a
Liquid Theme Check: Find dead codecommand to list them — but it's easy to miss because you have to know to run it. This surfaces it proactively: on activation, if the theme has orphaned files, the extension shows a single dismissable notification.themeCheck.checkOrphanedFilesOnBootsetting (defaulttrue), mirroring the existingthemeCheck.preloadOnBootpatternHow
ThemeGraphDeadCodeRequest(ThemeGraphManager.deadCode(rootUri)) — no server changes.workspace.findFiles('**/.theme-check.yml')(there's no active editor at boot), aggregates orphaned files across roots, and prompts once.makeDeadCodeto extractfetchDeadCode+showDeadCodePickerso the command and the startup check share logic —makeDeadCode's behavior is unchanged and covered by a characterization test.nodeandbrowseractivation, fire-and-forget so it never blocks or fails activation.Open questions (happy to adjust)
trueto match the issue's "prompt on start-up" intent, but happy to make it opt-in (false) if you'd prefer less startup noise.minor(new feature + setting); happy to drop topatchgiven the fixed version group.Testing
orphanedFilesOnBoot.spec.ts): disabled setting, no orphans, orphans → notification, "Don't show again" → setting update, "Review" → picker.makeDeadCodeto guard the refactor.theme-check-vscodevitest suite green (23 tests),tsc --noEmitclean, prettier clean.🤖 AI assistance
Drafted with Claude Code. I reviewed every change, ran the tests, and verified the approach against existing extension patterns. The orphaned-files detection this builds on is existing Shopify code; this PR adds the startup surfacing plus a shared refactor.