GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: スライド frontmatter theme (light/dark) を deck-level で指定可能に by ymnao · Pull Request #334 · ymnao/scripta

Conversation

@ymnao

@ymnao ymnao commented Jul 14, 2026

Copy link
Copy Markdown
Owner

概要

スライド deck の先頭 YAML frontmatter に theme: light | dark を書くと、app theme に関わらず deck 全体のテーマが preview / 発表モード / PDF export で固定される (Fable #12)。指定が無い / 不正値の場合は従来通り app theme にフォールバック。

副次的に、parseSlides が frontmatter を「区切り検出時に skip するだけで本文には含めていた」バグを修正 (旧実装は theme: を書いた瞬間に 1 枚目のスライドに生の YAML が漏れていた)。

関連 Issue

なし (Fable #12 提案分)

移行 Stage

  • Stage 6: 仕上げ・配布・切り替え

変更内容

  • extractSlideFrontmatterTheme(text): SlideTheme | null を src/lib/slide-parser.ts に追加 (parseFrontmatterBlock にリファクタして parseSlides と共有)
  • useSlideHtml / useSlideHtmls / SlideFrame に themeOverride?: SlideTheme | null prop を追加、.slide-theme-{light|dark} scoped CSS で .dark ancestor に関わらず deck-level テーマを固定
  • SlideView / AppLayout (F5 発表モード起動時) / exportSlidesAsPdf の 3 経路で frontmatter theme を反映
  • SLIDE_PDF_PALETTE を preview .slide-theme-* と 1:1 一致させ、link 色 (light #2563eb / dark #60a5fa) を PDF <style> に追加 (WYSIWYG 契約)
  • .slide-theme-* の CSS 変数値を :root (light) / .dark (dark) と完全一致させ、app theme と frontmatter theme が同一色になる契約に統一
  • SlideTheme 型を src/types/slide.ts に集約 (旧: 5+ 箇所で "light" | "dark" union を重複宣言)
  • parseSlides の bodyStart 計算を frontmatter 閉じ --- の直後に進め、slide 1 本文から frontmatter を除外 (from オフセットも合わせて更新)

動作確認

  • pnpm test (vitest, unit tests) — 2453 passed / 2 skipped
  • pnpm typecheck (tsconfig.json / tsconfig.node.json 両方) — clean
  • pnpm lint (biome) — clean
  • pnpm build (vite) — 成功
  • codex-review security — PASS (0 findings)
  • 手動 UI 検証 (packaged smoke): theme: dark を書いた md を開き preview / F5 発表モード / PDF export で dark 背景・text・link 色が反映されることを確認 (未実施、実 Electron 起動は sandbox 制約でローカル不可、CI/リリース時に確認)

スクリーンショット

省略 (テキスト仕様変更が主、UI 差分は「preview 背景が deck-level theme に固定される」のみ)

検証エビデンス

リスク分類

tier: medium — classify-risk.sh reasons: [] (heuristic 上は default medium)

実行した検証

種別 コマンド 結果
テスト ./node_modules/.bin/vitest run 2453 passed / 2 skipped (112 files)
Typecheck ./node_modules/.bin/tsc -p tsconfig.json --noEmit / -p tsconfig.node.json --noEmit 両方 clean
Lint ./node_modules/.bin/biome check src Fixed 2 files (format only), 以降 clean
Build ./node_modules/.bin/vite build 成功
レビュー codex-review security PASS (0 findings)
手動 e2e (実 Electron 起動) 未実施 (sandbox 制約、CI/リリース時)

レビュー指摘と対応

Perspective Verdict Findings Confirmed Refuted Fixed Report-only Unresolved
security PASS 0 - - - - -

(shell-senior / qa-fixture は tier=medium のため未実施。追加で /code-review medium を PR 前に自己実行し、4 findings 全て fix 済み: F1 frontmatter leak / F2 PDF-CSS palette 不一致 / F3 PDF link 色欠落 / F4 .slide-theme-dark text-secondary drift。)

追跡先

なし

Draft 判定

  • 判定: normal
  • 根拠: step 4 — codex-review security PASS、fix 必要な finding 無し、追跡別 PR も無し

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ymnao
feat: スライド frontmatter で theme を指定できるようにする
7afafcf
- スライド deck 先頭 YAML frontmatter の `theme: light | dark` を抽出する
  `extractSlideFrontmatterTheme` を追加 (Fable #12)
- preview / 発表モード / PDF export の 3 経路で frontmatter theme を反映
  (未指定時は app theme にフォールバック)
- `SlideFrame` に `themeOverride` prop を追加、`.slide-theme-{light|dark}`
  scoped CSS で `.dark` ancestor に関わらず deck-level テーマを固定
- `SLIDE_PDF_PALETTE` を preview `.slide-theme-*` と 1:1 一致させ、link 色
  (light #2563eb / dark #60a5fa) も揃えて WYSIWYG 契約を担保
- `SlideTheme` 型を `src/types/slide.ts` に集約
- 副次的に `parseSlides` の frontmatter 除外バグを修正 (旧実装は区切り検出のみ
  skip し frontmatter 本文を slide 1 に含めていたため、theme を書いた瞬間に
  preview へ生 YAML が漏れていた)
@ymnao
ymnao merged commit 5880b94 into main Jul 14, 2026
9 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ymnao
ymnao deleted the feature/slide-frontmatter-theme branch July 14, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@ymnao
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.