Skip to content

feat(tabs): pick code-group tab icons from the file extension - #455

Merged
vite-hub[bot] merged 2 commits into
mainfrom
feat/tabs-file-icons
Nov 17, 2026
Merged

vite-hub[bot] merged 2 commits into
mainfrom
feat/tabs-file-icons

Conversation

@onmax

@onmax onmax commented Nov 17, 2026

Copy link
Copy Markdown
Owner

A code group's tabs show an icon only when each code block writes icon= after its label, so [app.tsx] and [data.json] tabs had none unless the author looked up two Iconify names.

Now a code group's tab named after a file takes that file's icon from the VS Code set, the same one comark-file-tree draws for it: by whole name first (package.json, tsconfig.json), then by extension. The map moves from comark-file-tree to shared/file-icons.ts, so both packages draw a file alike. icon= and the icons option by label still win, and an icons key that starts with a dot, such as ".vue", sets an extension's icon. ::tabs labels and labels like [pnpm] are unchanged.

Like comark-file-tree, this needs an iconResolver from the host, which comark-ui passes. A bare tabs(), such as the one comark-linter loads, fetches nothing for a file. A file icon that doesn't load leaves its tab without one and adds no issue, since the document has nothing to fix.

Validation: the new tabs test ([app.tsx], [data.json], [package.json], [App.vue] with an extension override, icon= winning, [pnpm] and ::tabs without one) fails on main and passes here. The tabs and file-tree suites pass, and so do vp check, tsrs, the docs typecheck, and Vite Doctor. In pnpm test, only remark-to-comark's "refuses to migrate with no git repository" times out, the same on a branch that doesn't touch it. I haven't looked at the tabs in a browser.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T11:43:59.055498Z
We couldn’t complete this review. Comment @codex review to try again.
a9c495d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@455

comark-badge

pnpm add https://pkg.pr.new/comark-badge@455

comark-bundle

pnpm add https://pkg.pr.new/comark-bundle@455

comark-cards

pnpm add https://pkg.pr.new/comark-cards@455

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@455

comark-cast

pnpm add https://pkg.pr.new/comark-cast@455

comark-charts

pnpm add https://pkg.pr.new/comark-charts@455

comark-chat

pnpm add https://pkg.pr.new/comark-chat@455

comark-chips

pnpm add https://pkg.pr.new/comark-chips@455

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@455

comark-code

pnpm add https://pkg.pr.new/comark-code@455

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@455

comark-colors

pnpm add https://pkg.pr.new/comark-colors@455

comark-comments

pnpm add https://pkg.pr.new/comark-comments@455

comark-critic

pnpm add https://pkg.pr.new/comark-critic@455

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@455

comark-details

pnpm add https://pkg.pr.new/comark-details@455

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@455

comark-diff

pnpm add https://pkg.pr.new/comark-diff@455

comark-embed

pnpm add https://pkg.pr.new/comark-embed@455

comark-fields

pnpm add https://pkg.pr.new/comark-fields@455

comark-figure

pnpm add https://pkg.pr.new/comark-figure@455

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@455

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@455

comark-git-graph

pnpm add https://pkg.pr.new/comark-git-graph@455

comark-github

pnpm add https://pkg.pr.new/comark-github@455

comark-icon

pnpm add https://pkg.pr.new/comark-icon@455

comark-include

pnpm add https://pkg.pr.new/comark-include@455

comark-keys

pnpm add https://pkg.pr.new/comark-keys@455

comark-links

pnpm add https://pkg.pr.new/comark-links@455

comark-linter

pnpm add https://pkg.pr.new/comark-linter@455

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@455

comark-mark

pnpm add https://pkg.pr.new/comark-mark@455

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@455

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@455

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@455

comark-media

pnpm add https://pkg.pr.new/comark-media@455

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@455

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@455

comark-outline

pnpm add https://pkg.pr.new/comark-outline@455

comark-properties

pnpm add https://pkg.pr.new/comark-properties@455

comark-qr

pnpm add https://pkg.pr.new/comark-qr@455

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@455

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@455

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@455

comark-sources

pnpm add https://pkg.pr.new/comark-sources@455

comark-steps

pnpm add https://pkg.pr.new/comark-steps@455

comark-table

pnpm add https://pkg.pr.new/comark-table@455

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@455

comark-tests

pnpm add https://pkg.pr.new/comark-tests@455

comark-time

pnpm add https://pkg.pr.new/comark-time@455

comark-ui

pnpm add https://pkg.pr.new/comark-ui@455

comark-xref

pnpm add https://pkg.pr.new/comark-xref@455

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@455

commit: a36da2e

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Important

A valid code-group label can now abort parsing and rendering. The inherited-key lookup needs to be fixed before merging.

Reviewed changes — Reviewed the complete PR, including shared file-icon lookup, code-group inference, resolver behavior, tests, and documentation.

  • Shared file icons: Extracts the VS Code filename and extension mapping so file trees and code groups use the same defaults.
  • Code-group inference: Adds automatic file icons when a host resolver is supplied, preserves explicit and per-label precedence, supports extension overrides, and silently skips unresolved inferred icons.
  • Tests and documentation: Adds inference and fallback coverage and documents the new configuration behavior.

Validation: pnpm build and all 61 targeted tabs/file-tree tests passed; public parser and renderer probes reproduced the crash below.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

Comment thread shared/file-icons.ts Resolved
@vite-hub

vite-hub Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Waiting 2026-11-17T12:21:09.848Z 2m 29s
View session Completed 2026-11-17T11:56:40.110Z 4m 58s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

View session

Ready: verified the inherited-key fix and resolved review thread. All supplied HEAD checks pass. Locally, 44 tabs tests and 8 file-tree tests pass after building prerequisite packages; lint passes with warnings. Bypassed a pnpm database-access error using installed tools directly. No remaining actionable findings or source changes needed.

View session

Pushed a36da2e to fix the inherited-key crash and add public parse/render regressions. All 44 tabs tests and 11 file-tree tests pass; lint passes with warnings. Thread resolution was rejected because the provider detected a changed PR head, so the thread remains open for the next pass. Awaiting hosted checks.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found; no P0 or P1 findings remain.

Reviewed changes — Reviewed a36da2e, the fix and regression coverage added since the prior Pullfrog review at a9c495d.

  • Restricted file-icon lookup: Added own-property checks for both filename and extension candidates, preventing inherited keys from reaching the icon resolver while preserving lookup precedence.
  • Added regression coverage: Verified that constructor, __proto__, toString, and hasOwnProperty remain plain labels during parsing and HTML rendering, with and without a host resolver.

Validation: all 62 targeted tabs/file-tree tests passed, as did eight regression scenarios through built public exports. Direct builds of zoom, icon, tabs, and file-tree passed, including publint; pnpm build was blocked by the environment error error: could not lock config file .git/config: Read-only file system.

Pullfrog  | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

@vite-hub
vite-hub Bot merged commit 321969f into main Nov 17, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the feat/tabs-file-icons branch November 17, 2026 12:29
@github-actions github-actions Bot mentioned this pull request Nov 17, 2026
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