Skip to content

feat: add verse mode tab (📜 聖句) with SSE spiritual reading - #18

Draft
codowave wants to merge 2 commits into
mainfrom
claude/biblical-verse-mode-tab-wdjb0i
Draft

feat: add verse mode tab (📜 聖句) with SSE spiritual reading#18
codowave wants to merge 2 commits into
mainfrom
claude/biblical-verse-mode-tab-wdjb0i

Conversation

@codowave

Copy link
Copy Markdown
Owner

Summary

  • 新タブ「📜 聖句」を追加 — 既存の「💬 対話」「📖 辞典」タブに並列追加
  • /api/verse エンドポイント追加 — 聖句テキストから辞典語を抽出し、Claude Opus 4.6 が相応的読解をSSEストリーミング
  • フロントエンド対応 — 語カード横スクロール + 読解テキストのリアルタイム表示

変更内容

app.py

  • VerseRequest モデル追加(verse_text: str
  • VERSE_SYSTEM プロンプト:字義→内意→価値変換の順、典拠引用、価値変換圧縮一行を指示
  • stream_verse_response(): 辞典エントリとのワード照合 → {"type":"words"} SSEイベント → Claude読解テキストの {"type":"text"} ストリーミング
  • POST /api/verse エンドポイント

static/index.html

  • 📜 聖句 タブ追加
  • switchTab() を3タブ対応に更新(TAB_NAMES 配列で管理)
  • 聖句パネルHTML:テキストエリア+「読解する」ボタン
  • 語カードCSS(横スクロール、.word-card
  • 読解エリアCSS(.verse-reading
  • readVerse() 関数:SSE受信 → wordsイベントでカード描画 → textイベントでストリーミング表示

Test plan

  • 「📜 聖句」タブをタップしてパネルが表示される
  • 聖句テキスト(例:「主は私の羊飼い、私は乏しいことがない」)を入力して「読解する」
  • 辞典登録語(「羊飼い」など)がカード一覧に表示される
  • Claude の相応的読解がリアルタイムストリーミングで表示される
  • 辞典語ゼロの聖句でも読解が生成される
  • 既存の「対話」「辞典」タブが引き続き正常動作する

https://claude.ai/code/session_01PRWj3E6TDjvzgmVqxEigak


Generated by Claude Code

- Add /api/verse endpoint: extracts dictionary words from verse text,
  streams words list then Claude Opus 4.6 spiritual reading via SSE
- Add 📜 聖句 tab to UI: textarea input, horizontal word cards,
  streaming 相応的読解 output panel
- Update switchTab() to handle three tabs (chat/dict/verse)

https://claude.ai/code/session_01PRWj3E6TDjvzgmVqxEigak

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new feature to analyze and stream spiritual readings of biblical verses based on Swedenborg's correspondence principles. It adds a /api/verse POST endpoint in the backend and a corresponding "Verse" tab in the frontend UI. The review feedback highlights a critical improvement opportunity in the frontend's API call: adding proper error handling for non-200 HTTP responses or empty response bodies to prevent the UI from hanging in a loading state.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread biblical_correspondence/static/index.html
Throw early on HTTP errors or empty response body so the catch block
renders the error message and re-enables the button instead of hanging.

https://claude.ai/code/session_01PRWj3E6TDjvzgmVqxEigak
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.

2 participants