feat: fold hierarchical tags with '/' in Versions tab#34
Conversation
When any tag name contains a forward slash (as commonly seen in monorepo setups, e.g. component/v1.0.0), the Versions tab now renders a collapsible tree instead of a flat list. Tags are grouped by the prefix before the first '/', and each group starts collapsed. Groups auto-expand when the currently selected version lives inside them. - Added CSS for .vtree-group-hdr, .vtree-item, .vtree-chevron, etc. - Added _renderVerTree() to build the grouped HTML - Added toggleTreeGroup() to expand/collapse a group - Updated selectVersion() to use data-vidx attribute for highlight (works in both flat and tree modes) Closes #31
When a version is selected via URL parameters, the selected row could remain hidden inside a collapsed vtree-group-hdr. Now selectVersion walks backwards from the selected row to find its group header and calls toggleTreeGroup to expand it if the row is not visible. https://claude.ai/code/session_01EVUptUcqgjMwB6W7W1SsGE
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds hierarchical tag tree rendering to the versions list in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@dfetch_hub/site/index.html`:
- Line 935: The clickable tree group header (tr with class "vtree-group-hdr"
that calls toggleTreeGroup(this)) is not keyboard accessible; update the element
creation to include tabindex="0", role="button", and an accessible state like
aria-expanded set from the open variable, and add a keydown handler (or attach
via the existing toggleTreeGroup) that triggers toggleTreeGroup(this) when Enter
or Space is pressed; ensure the same changes are applied to the other similar
headers around lines 951-957 so keyboard and assistive tech users can
expand/collapse groups.
- Around line 868-875: The long inline ternary/mapper for populating
document.getElementById('vtbody').innerHTML with allRefsCache should be split
into smaller helper functions: extract the row rendering logic into a function
(e.g., renderVersionRow(ref, index) that uses esc(ref.name), ref.kind,
ref.commit_sha, ref.date and calls selectVersion(index) on click), keep the tree
path using the existing _renderVerTree(allRefsCache) and delegate to a flat
renderer that maps allRefsCache.map(renderVersionRow). Ensure you reference
curVersion when computing sel and preserve hasHierTags, _renderVerTree,
allRefsCache, selectVersion, esc, and curVersion names so the final assignment
becomes a short conditional that calls the helpers and stays well under 120
characters per line.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6a4e0d07-8956-4a0d-a981-20190d9027be
📒 Files selected for processing (1)
dfetch_hub/site/index.html
When any tag name contains a forward slash (as commonly seen in monorepo
setups, e.g. component/v1.0.0), the Versions tab now renders a collapsible
tree instead of a flat list. Tags are grouped by the prefix before the
first '/', and each group starts collapsed. Groups auto-expand when the
currently selected version lives inside them.
(works in both flat and tree modes)
Closes #31
Summary by CodeRabbit