Fix folders not appearing when first workflow belongs to a folder#11
Merged
Conversation
applyGrouping captured the first workflow item as an insertion anchor, then called createFolderElement which moves grouped items out of the parent ul. If the first item belonged to a folder, the anchor was detached before ul.insertBefore ran, throwing NotFoundError and preventing any folders from appearing. Build all folder elements into a DocumentFragment first, then prepend the fragment to ul. The anchor problem disappears because we no longer reference a child that might be moved. Co-Authored-By: Claude Opus 4.7 (1M context) <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
applyGroupingで先頭ワークフロー項目をinsertBeforeのアンカーとして取得していたが、createFolderElementがグループ化対象アイテムをulから子フォルダーへ移動するため、先頭アイテムがフォルダー化対象だと参照が無効化されてNotFoundError: ... not a child of this nodeで挿入が失敗していたDocumentFragmentに組み立ててからulの先頭へ挿入する形に変更し、移動される子要素をアンカーとして参照しないようにしたTest plan
anthropics/claude-code/actions、先頭が.github/workflows/autopr.yml)に修正後ロジックを注入し、.github (2)フォルダーが先頭に表示されることを確認npm test(vitest) すべてグリーンnpm run lint(ESLint + Stylelint) クリーン🤖 Generated with Claude Code