Skip to content

ISTQB CTFL v4.0 関連ドキュメントの Next.js への移行、レイアウト・デザインの復元および最適化、そして Mermaid ダイアグラムのレンダリングバグの包括的修正#80

Merged
myoshi2891 merged 25 commits into
mainfrom
dev
Jun 30, 2026
Merged

Conversation

@myoshi2891

@myoshi2891 myoshi2891 commented Jun 15, 2026

Copy link
Copy Markdown
Owner

主に ISTQB CTFL v4.0 関連ドキュメントの Next.js への移行レイアウト・デザインの復元および最適化、そして Mermaid ダイアグラムのレンダリングバグの包括的修正 が行われました。


1. 開発ルールの明記と安全性強化

  • Antigravity サンドボックス制限の追加 (コミット: 7803919)
    • GEMINI.md に、Antigravity(AIエージェント)が自律的・自動的に本番ビルドコマンド(bun run build など)を実行することを禁止するルールを明記しました(メモリ過多によるクラッシュ防止のため)。

2. ISTQB CTFL v4.0 ガイドの Next.js 移行とデザイン最適化

  • Next.js への移行とテスト追加 (コミット: b8715d1 〜 83b5e49)
    • Istqb-ctfl.html を Next.js App Router () に完全移行しました。

      page.tsx

    • 専用のナビゲーションバー(NavBar.tsx)やスタイルシート(istqb-ctfl-complete-guide.css)、コントラクトテストを新規追加しました。

  • レイアウトの拡張とサイドバーの復元 (コミット: 62de8b3 〜 f7b91c2)
    • メインコンテンツの最大幅制限(max-width)を拡張し、ワイド画面でも快適に閲覧できるように調整しました。
    • 元の HTML が持っていたサイドバーデザインを忠実に復元し、ナビゲーションのカテゴリ階層の位置を調整しました。

3. Mermaid ダイアグラム描画ロジックの改善 (Canonical パターン)

  • SVG レンダリングの安定化 (コミット: 884fb62 〜 b49288b99d8700607dd77)
    • Mermaid.tsx コンポーネントをリファクタリングし、SVG 描画の諸問題を解決する applySvgFixups パターン を導入しました。

      • フォントサイズ制限: 視認性を担保するため、ダイアグラム内のフォントサイズが最小 16px (1rem) になるよう矯正。
      • 改行サポート: 改行文字(\n)を適切に <br> タグへ変換し、HTML ラベルでの改行を可能に。
      • サイズ自動計算: TD (上から下) や LR (左から右) といったグラフの構造に合わせて、幅や高さをインテリジェントに算出し、はみ出しや見切れを防ぐ。
      • バグ修正: グラフデータが空になった際に古い SVG が残存する問題をクリアする処理を追加。
    • この修正パターンと手順を  に集約・ドキュメント化しました。

      .claude/skills/fix-mermaid/SKILL.md

4. CTFL v4.0 各章(Chapter 1 & 2)の詳細化と整理

  • ドキュメントの分割再構成 (コミット: 03c8ab3 〜 9257915)

  • Chapter 1 & 2 HTML の移行と微修正 (コミット: 03c8ab3 〜 607dd77)

    • Ctfl-v4-chapter2-sdlc-and-testing.html の追加に伴い、Mermaid の構文エラーによる描画クラッシュを修正しました。
    • CT-AI 試験終了日の日付ミスを修正。また、スクロール時のアンカー追従位置を正確にするため、アンカーIDを見出し(h1h3)タグへ直接配置する修正を加えました。

変更された主なファイルと進捗

  • 移行状況の記録:

    MIGRATION_PROGRESS.md

  • 追加されたページとテストapp/istqb-ctfl-complete-guide/tests/istqb-ctfl-complete-guide/

@netlify

netlify Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deploy Preview for quality-assurance-studies ready!

Name Link
🔨 Latest commit 3712164
🔍 Latest deploy log https://app.netlify.com/projects/quality-assurance-studies/deploys/6a43a176c077c200088c0498
😎 Deploy Preview https://deploy-preview-80--quality-assurance-studies.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@myoshi2891, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7d7d530b-e400-42f2-b4c2-b71bc1020962

📥 Commits

Reviewing files that changed from the base of the PR and between f93caad and 3712164.

📒 Files selected for processing (3)
  • app/istqb-ctfl-complete-guide/NavBar.tsx
  • app/istqb-ctfl-complete-guide/page.tsx
  • components/Mermaid.tsx
📝 Walkthrough

Walkthrough

Mermaid の SVG 後処理と運用手順を更新し、ISTQB CTFL v4.0 完全ガイドの Next.js ページ、ナビゲーション、学習文書、関連テスト、移行記録を追加・更新しました。

Changes

Mermaid 後処理と運用ガイダンス

Layer / File(s) Summary
運用ガイダンス更新
.claude/skills/fix-mermaid/SKILL.md
再利用スクリプトの利用手順、SVG 幅制御、viewBox 高さ補正、v11 移行、サニタイズ対策、確認手順を追記。
Mermaid 実装と表示
components/Mermaid.tsx, app/globals.css, tests/components/Mermaid.test.tsx
Mermaid 初期化設定と SVG 後処理を実 DOM 操作へ変更し、グローバルラッパースタイルとテスト期待値を更新。

ISTQB CTFL v4.0 完全ガイドの追加

Layer / File(s) Summary
CTFL ページ枠と本文
app/istqb-ctfl-complete-guide/NavBar.tsx, app/istqb-ctfl-complete-guide/istqb-ctfl-complete-guide.css, app/istqb-ctfl-complete-guide/page.tsx, Ctfl-v4-chapter1-fundamentals.md, Ctfl-v4-chapter2-sdlc-and-testing.md, Ctfl-v4-chapter3-static-testing.md
クライアント NavBar、ページ固有 CSS、ページ本体、章 1〜3 の学習文書を追加。
登録・検証・記録
lib/navigation.ts, e2e/pages.ts, docs/coverage-dashboard.html, tests/lib/navigation.test.ts, tests/istqb-ctfl-complete-guide/page.test.tsx, GEMINI.md, CLAUDE.md, docs/MIGRATION_PROGRESS.md
ナビゲーション登録、E2E ページ定義、カバレッジ集計、ナビゲーションテスト、移行記録を更新。

推定コードレビュー工数

🎯 4 (Complex) | ⏱️ ~60 minutes

関連する可能性のある PR

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed GEMINI.mdのビルドルール更新に加え、CTFL移行やMermaid修正などの変更内容も概ね説明できており、変更差分と関連しています。
Title check ✅ Passed 変更内容の主要点であるCTFLガイド移行、レイアウト調整、Mermaid修正を具体的に示しています。

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- Migrated Mermaid diagrams to JS template literal format to prevent Prettier formatting corruption
- Fixed typo in whitebox testing node (ブランクカバレッジ -> ブランチカバレッジ)
- Expanded main content width to full screen and positioned sidebar to the left edge
- Added the markdown source for the CTFL v4.0 comprehensive guide
- Formatted lists, blockquotes, and code fences for strict .markdownlint.json rules
- Wrapped bare URLs with angle brackets to resolve MD034 lint errors
…d fix Mermaid diagrams using dynamic rendering
@myoshi2891

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 11

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/istqb-ctfl-complete-guide/istqb-ctfl-complete-guide.css`:
- Around line 80-85: The page still uses hardcoded 60px/84px offsets, so
`--disclaimer-height` is not being applied consistently. Update the
`istqb-ctfl-layout` spacing and the sticky sidebar/anchor styles in
`istqb-ctfl-complete-guide.css` to use the same `calc(60px +
var(--disclaimer-height, 0px))` expression for `margin-top`, `top`, `height`,
and `scroll-margin-top`, and ensure the sidebar sticky nav keeps the required
`z-index: 40`.

In `@app/istqb-ctfl-complete-guide/page.tsx`:
- Around line 874-876: The JSX text in the relevant paragraph contains an
unescaped apostrophe in the “Don't Care” phrase, which will trigger the
react/no-unescaped-entities check. Update the text in the affected paragraph
within the page component to use the escaped form `Don&apos;t Care` so the JSX
linter passes cleanly.
- Around line 1466-1675: The external links in this section use target="_blank"
without rel="noopener noreferrer", which leaves the opener tab exposed. Update
the anchor tags in the URL list and footer-note area so every target="_blank"
link also includes rel="noopener noreferrer"; use the repeated link markup in
page.tsx as the place to apply this consistently.
- Around line 26-37: The sidebar hash links jump to section/div IDs and the
target headings are hidden under the fixed header because the scroll offset is
only applied to h2/h3 styles. Update the anchor targets in page.tsx so
NavBar.tsx links land on visible content by either moving the IDs from
section/div wrappers onto the actual heading elements or applying a shared
scroll-margin-top to all elements that receive those IDs, and apply the same
pattern consistently across the other affected sections.

In `@CLAUDE.md`:
- Line 315: Update CLAUDE.md to remove the self-contradicting guidance: in the
“session end checklist” stop requiring autonomous execution of bun run build and
replace it with the Antigravity rule that build verification must be requested
from the user instead of run directly. Also refresh the restart prompt text so
it no longer points to the stale e80058b / 34 route and instead matches the
current repo state and the new build restriction, keeping the checklist and
resume instructions consistent with the CTFL entry already added.

In `@components/Mermaid.tsx`:
- Around line 89-93: `Mermaid.tsx` の `renderMermaid` で `mermaid.render()` を呼ぶ前に
Web フォントの読み込み完了を待つようにしてください。初回描画時に `Noto Sans JP`
が未読込でもレイアウト確定しないよう、`renderMermaid` 内でフォント準備を待機してから `mermaid.render(id, chart)`
を実行し、`setSvgStr` に渡す SVG が正しい文字幅で生成されるように修正してください。

In `@Ctfl-v4-chapter1-fundamentals.md`:
- Around line 447-449: Markdown テーブルの行頭インデントが不揃いで、`**ドメイン知識**`
の行だけ余分なスペースが入っています。`Ctfl-v4-chapter1-fundamentals.md` の該当テーブルで、`**テスト固有の知識**` や
`**分析的思考**` と同じ行頭位置に揃えるように、`**ドメイン知識**` の先頭の不要な空白を हटしてください。

In `@Ctfl-v4-chapter2-sdlc-and-testing.md`:
- Around line 184-194: The Gherkin example under the BDD section uses a fenced
code block without a language tag, which violates the Markdown guideline; update
the snippet to use the appropriate language tag for the content, specifically
the Gherkin example around the BDD heading, so the block is clearly identified
and consistent with the rest of the document.
- Line 5: Chapter 2 currently only shows the exam weighting near the top, so add
an optional end-of-file recap section that repeats the 試験配点 summary (7問 / K1: 2問
/ K2: 5問) similar to Chapter 1. Place it in the final confirmation area of
Ctfl-v4-chapter2-sdlc-and-testing.md so readers can quickly verify the
allocation without searching back to the beginning.

In `@docs/MIGRATION_PROGRESS.md`:
- Around line 18-31: The archive destination path is inconsistent in this
migration log, with references split between archive/html-archive/ and
html-archive/, so update the entries in MIGRATION_PROGRESS.md to use one
canonical path throughout. Keep the wording aligned with the existing migration
item that mentions Istqb-ctfl.html and the archive location, and make sure the
table/header references and the bullet text point to the same archive target.

In `@tests/lib/navigation.test.ts`:
- Around line 5-6: The navigation test currently only checks the total NAV_ITEMS
length, so it can miss misclassification or swapped entries. Update the
NAV_ITEMS assertions in navigation.test.ts to also pin the new CTFL entry by its
href and category, specifically verifying that /istqb-ctfl-complete-guide is
included under istqb-foundation-ext. Keep the length check, but add a direct
entry-level assertion using the NAV_ITEMS structure so this regression is caught
even if other items are rearranged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a0c97891-c66d-4c45-ac3e-e120721e696d

📥 Commits

Reviewing files that changed from the base of the PR and between 96ad50b and 9257915.

📒 Files selected for processing (19)
  • .claude/skills/fix-mermaid/SKILL.md
  • CLAUDE.md
  • Ctfl-v4-chapter1-fundamentals.html
  • Ctfl-v4-chapter1-fundamentals.md
  • Ctfl-v4-chapter2-sdlc-and-testing.md
  • GEMINI.md
  • app/globals.css
  • app/istqb-ctfl-complete-guide/NavBar.tsx
  • app/istqb-ctfl-complete-guide/istqb-ctfl-complete-guide.css
  • app/istqb-ctfl-complete-guide/page.tsx
  • archive/html-archive/Istqb-ctfl.html
  • components/Mermaid.tsx
  • docs/MIGRATION_PROGRESS.md
  • docs/coverage-dashboard.html
  • e2e/pages.ts
  • lib/navigation.ts
  • tests/components/Mermaid.test.tsx
  • tests/istqb-ctfl-complete-guide/page.test.tsx
  • tests/lib/navigation.test.ts

Comment thread app/istqb-ctfl-complete-guide/istqb-ctfl-complete-guide.css
Comment thread app/istqb-ctfl-complete-guide/page.tsx Outdated
Comment thread app/istqb-ctfl-complete-guide/page.tsx
Comment thread app/istqb-ctfl-complete-guide/page.tsx Outdated
Comment thread CLAUDE.md
Comment thread Ctfl-v4-chapter1-fundamentals.md
Comment thread Ctfl-v4-chapter2-sdlc-and-testing.md
Comment thread Ctfl-v4-chapter2-sdlc-and-testing.md
Comment thread docs/MIGRATION_PROGRESS.md
Comment thread tests/lib/navigation.test.ts
@myoshi2891

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
components/Mermaid.tsx (1)

85-88: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

chart が空になったときに既存 SVG をクリアしてください。

Line 87 で早期 return すると、非空の chart を描画した後に chart="" へ変わった場合、前回の SVG が残り続けます。chart 変更時に一度 svgStr を空にしておくと、古い図が新しい chart で後処理される一瞬の不整合も避けられます。

修正案
     useEffect(() => {
         let isMounted = true;
-        if (!chart) return;
+        setSvgStr('');
+        if (!chart) {
+            return () => {
+                isMounted = false;
+            };
+        }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/Mermaid.tsx` around lines 85 - 88, The Mermaid rendering effect in
Mermaid.tsx leaves the previous SVG on screen when chart becomes empty because
the early return skips cleanup. Update the useEffect logic so that when chart is
falsy it clears the existing svgStr before returning, and make sure the Mermaid
rendering path still uses the current chart value in the effect keyed on chart
to avoid stale SVG being shown.
app/istqb-ctfl-complete-guide/page.tsx (1)

173-176: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

CT-AI v1.0 の英語試験終了年が 1 年早く書かれています。

ここは「v1.0 は 2027年4月に英語試験終了」ではなく、実際には 2027年4月21日 まで英語版の training / exams が継続です。2026年終了と案内すると受験計画を誤らせるので、年号を修正してください。 (istqb.org)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/istqb-ctfl-complete-guide/page.tsx` around lines 173 - 176, The CT-AI
timeline text in the page content is incorrect: the statement in the section
that mentions CT-AI v2.0 and CT-AI v1.0 says the English exam ends in 2027-04,
but the review notes the actual end date is 2027-04-21. Update the CT-AI v1.0
English training/exam end date in this block of the page.tsx content so the
rendered guidance matches the official ISTQB schedule.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@app/istqb-ctfl-complete-guide/page.tsx`:
- Around line 173-176: The CT-AI timeline text in the page content is incorrect:
the statement in the section that mentions CT-AI v2.0 and CT-AI v1.0 says the
English exam ends in 2027-04, but the review notes the actual end date is
2027-04-21. Update the CT-AI v1.0 English training/exam end date in this block
of the page.tsx content so the rendered guidance matches the official ISTQB
schedule.

In `@components/Mermaid.tsx`:
- Around line 85-88: The Mermaid rendering effect in Mermaid.tsx leaves the
previous SVG on screen when chart becomes empty because the early return skips
cleanup. Update the useEffect logic so that when chart is falsy it clears the
existing svgStr before returning, and make sure the Mermaid rendering path still
uses the current chart value in the effect keyed on chart to avoid stale SVG
being shown.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4edf5ee6-12f9-4d40-adc5-1d5569e658a1

📥 Commits

Reviewing files that changed from the base of the PR and between 9257915 and d4dc9c6.

📒 Files selected for processing (9)
  • CLAUDE.md
  • Ctfl-v4-chapter1-fundamentals.md
  • Ctfl-v4-chapter2-sdlc-and-testing.html
  • Ctfl-v4-chapter2-sdlc-and-testing.md
  • app/istqb-ctfl-complete-guide/istqb-ctfl-complete-guide.css
  • app/istqb-ctfl-complete-guide/page.tsx
  • components/Mermaid.tsx
  • docs/MIGRATION_PROGRESS.md
  • tests/lib/navigation.test.ts

@myoshi2891

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@myoshi2891 myoshi2891 changed the title chore(docs): clarify build execution rules for Antigravity sandbox en… ISTQB CTFL v4.0 関連ドキュメントの Next.js への移行、レイアウト・デザインの復元および最適化、そして Mermaid ダイアグラムのレンダリングバグの包括的修正 Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #81

Docstrings generation was requested by @myoshi2891.

* #80 (comment)

The following files were modified:

* `app/istqb-ctfl-complete-guide/NavBar.tsx`
* `app/istqb-ctfl-complete-guide/page.tsx`
* `components/Mermaid.tsx`
@coderabbitai coderabbitai Bot mentioned this pull request Jun 30, 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