Skip to content

[trees] Path Store | Icons#501

Merged
SlexAxton merged 3 commits intomainfrom
alex/trees/phase-5b
Apr 14, 2026
Merged

[trees] Path Store | Icons#501
SlexAxton merged 3 commits intomainfrom
alex/trees/phase-5b

Conversation

@SlexAxton
Copy link
Copy Markdown
Contributor

image

This pulls the icon-specific work out of the saved Phase 5 bundle so the
path-store tree can render custom file icons and built-in icon tiers before the
remaining composition surfaces land. The server and client now share one icon
configuration path, the path-store view resolves file icons with the same rule
priority as legacy trees, and focused regression tests cover SSR sprite output,
custom remaps, and default built-in fallback behavior.

Constraint: User requested an icons-only commit from the saved Phase 5 work
Rejected: Land icons together with context menu and decorator work | wanted a smaller reviewable slice
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep later decorator/context-menu work layering on this icon resolver instead of reintroducing hardcoded file icon selection
Tested: Targeted oxlint on changed files; bun ws trees build; bun ws trees tsc; bun test packages/trees/test/path-store-icon-config.test.ts and packages/trees/test/path-store-render-scroll.test.ts
Not-tested: Full root lint remains noisy from unrelated existing docs/demo files
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierrejs-diff-demo Ready Ready Preview Apr 14, 2026 0:56am
pierrejs-docs Ready Ready Preview Apr 14, 2026 0:56am

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97e83dcfd2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +51 to +53
const fileTree = new PathStoreFileTree({
...options,
icons: initialIconsRef.current,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Initialize remounts with the current icon config

This effect rebuilds PathStoreFileTree with initialIconsRef.current, which is captured only on first render. If containerHtml or options changes after the user has switched icon mode, the tree is recreated with the original icon set (typically complete), and the useEffect([icons]) path may not run to fix it when icons itself did not change in that render. That causes the UI mode and rendered icons to drift on remounts.

Useful? React with 👍 / 👎.

@SlexAxton SlexAxton merged commit ecc5254 into main Apr 14, 2026
10 checks passed
@SlexAxton SlexAxton deleted the alex/trees/phase-5b branch April 14, 2026 00:58
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