fix(trees): I want to use remap when the set is standard or complete but ATM those sets skip over remap#710
Open
StefanDBTLabs wants to merge 1 commit into
Conversation
…efault' fallback With set:'standard' or set:'complete', resolveBuiltInFileIconToken always returns a token — including 'default' for files with no specific match. This caused the iconRemap check to be skipped entirely, making remap['file-tree-icon-file'] unreachable as a generic file icon fallback unless the caller used set:'minimal'. Fix: when the resolved built-in token is the generic 'default', check iconRemap['file-tree-icon-file'] first. Specific tokens (typescript, python, etc.) are unaffected. Falls back to file-tree-builtin-default if no remap entry is defined, preserving existing behaviour.
|
@StefanDBTLabs is attempting to deploy a commit to the Pierre Computer Company Team on Vercel. A member of the Team first needs to authorize it. |
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.
Description
remapis a great way to quickly override icons. But remap only works when thesetisminimal. Specifically I am trying to remapfile-tree-icon-file. The docs seem to suggest this should work but it did not.Motivation & Context
With
set:'standard'orset:'complete',resolveBuiltInFileIconTokenalways returns a token — including'default'for files with no specific extension match. This causes theiconRemapcheck to be skipped entirely, makingremap['file-tree-icon-file']unreachable as a generic file icon fallback unless the caller usesset:'minimal'.Root cause: In
iconResolver.ts, the built-in token path returns early before theiconRemapcheck wheneverbuiltInToken != null. SinceresolveBuiltInFileIconTokenreturns'default'as a catch-all forstandard/complete, the remap is never consulted.When the resolved built-in token is the generic
'default', we now checkiconRemap['file-tree-icon-file']first. Specific tokens (typescript,python, etc.) are unaffected — they continue to short-circuit before the remap check. Falls back tofile-tree-builtin-defaultif no remap entry is defined, preserving existing behaviour.set:'complete'+ unknown extension + remap defined#file-tree-builtin-defaultset:'complete'+ known extension (.ts) + remap defined#file-tree-builtin-typescript#file-tree-builtin-typescript✓set:'complete'+ unknown extension + no remap#file-tree-builtin-default#file-tree-builtin-default✓set:'minimal'+ remap definedType of changes
first discussed with the dev team and they should be aware that this PR is
being opened
You must have first discussed with the dev team and they should be aware
that this PR is being opened
Checklist
bun run lint)bun run format)bun test)How was AI used in generating this PR
I found this issue while using claude and trying to replace the default file icon while using the complete set. After reading the docs and looking at the code with claude's help I found that rename only works in the minimal set. So I set minimal and my remap and then rebuilt my own set by exporting all the svg icons and css styles. While this worked it was very awkward.
I then used claude to help write the bug ticket and finally to write the code for this PR, which I carefully reviewed, and help with parts of the explanation of the technical details. I hope my balance of human work and LLMs is acceptable and if not I apologize.
Related issues
#707