Skip to content

Fix folders not appearing when first workflow belongs to a folder#11

Merged
kimuchanman merged 1 commit into
mainfrom
feat/folders-on-top
Jun 4, 2026
Merged

Fix folders not appearing when first workflow belongs to a folder#11
kimuchanman merged 1 commit into
mainfrom
feat/folders-on-top

Conversation

@kimuchanman

@kimuchanman kimuchanman commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • applyGrouping で先頭ワークフロー項目を insertBefore のアンカーとして取得していたが、createFolderElement がグループ化対象アイテムを ul から子フォルダーへ移動するため、先頭アイテムがフォルダー化対象だと参照が無効化されて NotFoundError: ... not a child of this node で挿入が失敗していた
  • フォルダー要素を一旦 DocumentFragment に組み立ててから ul の先頭へ挿入する形に変更し、移動される子要素をアンカーとして参照しないようにした

Test plan

  • Playwrightで実 GitHub Actions ページ(anthropics/claude-code/actions、先頭が .github/workflows/autopr.yml)に修正後ロジックを注入し、.github (2) フォルダーが先頭に表示されることを確認
  • npm test (vitest) すべてグリーン
  • npm run lint (ESLint + Stylelint) クリーン

🤖 Generated with Claude Code

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>
@kimuchanman kimuchanman marked this pull request as ready for review June 4, 2026 04:51
@kimuchanman kimuchanman merged commit 7ede2dd into main Jun 4, 2026
3 checks passed
@kimuchanman kimuchanman deleted the feat/folders-on-top branch June 4, 2026 04:51
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