Skip to content

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
pierrecomputer:mainfrom
StefanDBTLabs:fix/remap-unreachable-with-complete-set
Open

fix(trees): I want to use remap when the set is standard or complete but ATM those sets skip over remap#710
StefanDBTLabs wants to merge 1 commit into
pierrecomputer:mainfrom
StefanDBTLabs:fix/remap-unreachable-with-complete-set

Conversation

@StefanDBTLabs
Copy link
Copy Markdown

@StefanDBTLabs StefanDBTLabs commented May 19, 2026

Description

remap is a great way to quickly override icons. But remap only works when the set is minimal. Specifically I am trying to remap file-tree-icon-file. The docs seem to suggest this should work but it did not.

Motivation & Context

With set:'standard' or set:'complete', resolveBuiltInFileIconToken always returns a token — including 'default' for files with no specific extension match. This causes the iconRemap check to be skipped entirely, making remap['file-tree-icon-file'] unreachable as a generic file icon fallback unless the caller uses set:'minimal'.

Root cause: In iconResolver.ts, the built-in token path returns early before the iconRemap check whenever builtInToken != null. Since resolveBuiltInFileIconToken returns 'default' as a catch-all for standard/complete, the remap is never consulted.

When the resolved built-in token is the generic 'default', we now check iconRemap['file-tree-icon-file'] first. Specific tokens (typescript, python, etc.) are unaffected — they continue to short-circuit before the remap check. Falls back to file-tree-builtin-default if no remap entry is defined, preserving existing behaviour.

Scenario Before After
set:'complete' + unknown extension + remap defined #file-tree-builtin-default remap icon ✓
set:'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 defined remap icon ✓ remap icon ✓

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality). You must have
    first discussed with the dev team and they should be aware that this PR is
    being opened
  • Breaking change (fix or feature that would change existing functionality).
    You must have first discussed with the dev team and they should be aware
    that this PR is being opened
  • Documentation update

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (bun run lint)
  • My code is formatted properly (bun run format)
  • I have updated the documentation accordingly (if applicable)
  • I have added tests to cover my changes
  • All new and existing tests pass (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

…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.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

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

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