refactor(detail): split SkillDetail.jsx into focused modules - #10
Merged
Merged
Conversation
Pure move of splitFrontmatter / extractHeadings / slugifyHeading / parseFrontmatterPairs out of SkillDetail.jsx, plus unit tests pinning their current behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ighlight marked/hljs setup, languageForPath, highlightCode, splitHighlightedLines, the render LRU and renderMarkdown move out of SkillDetail.jsx unchanged. Only the lazily loaded detail chunk imports it, so the entry bundle size is unchanged (app 100.14 kB before and after). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
buildFileTree, FileTreeNode, the path filter, open-dir state and the resizable width move into components/detail/FileTreeSidebar.jsx. The auto-collapse ResizeObserver stays in SkillDetail (it watches the detail scroll area) and drives the sidebar through collapsed / onCollapse / onExpand. SkillDetail is keyed by skill id, so the moved state still resets per skill exactly as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Breadcrumb, meta chips, copy/download/history buttons, the overflow menu (with its outside-click / Escape handling) and the preview/edit switch move to components/detail/DetailToolbar.jsx. Copy feedback, the version modal and save/mode logic stay in SkillDetail and are passed in. The breadcrumb regression test now reads the toolbar file; its assertions are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Outline visibility preference, the viewport-width gate, scroll-spy and jumpToHeading move to hooks/useDocOutline.js; the outline nav / restore button JSX moves to components/detail/DocOutline.jsx. The four-part visibility condition that was repeated three times is now one 'visible' flag. The hook is called right after the heading-id DOM patch effect so effect order is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Pure move, no intended behaviour change.
SkillDetail.jsx987 → 401 lines, split in 5 independently green commits:utils/markdownDoc.jsutils/highlight.jscomponents/detail/FileTreeSidebar.jsxcomponents/detail/DetailToolbar.jsxhooks/useDocOutline.js+components/detail/DocOutline.jsxDraft / save /
apiReflogic intentionally stays inSkillDetail.jsx.Verification
npm run check: lint (same 4 pre-existing warnings, none in touched files), 38/38 tests (+9 new unit tests for moved pure helpers), build OKoxlint -D no-undef -D no-unused-varson all moved code: clean apart from browser globalsui-regression.test.mjsbreadcrumb test now readsDetailToolbar.jsx; assertions unchanged.🤖 Generated with Claude Code