Repository navigation
feat: プレビュー表示機能を実装 - #27
Merged
Merged
Conversation
リスト選択モードで下部にMarkdownプレビューを表示し、カーソル移動と連動して更新する機能を実装しました。
依存ライブラリ:
- github.com/charmbracelet/bubbles/viewport を使用
実装内容:
- internal/ui/models.go の更新
- viewport.Model を追加(スクロール可能なプレビュー表示)
- ready フラグを追加(viewport 初期化管理)
- updatePreview() 関数を実装
- 選択中のタスクを取得
- render.RenderMarkdown() でMarkdownレンダリング
- viewport に表示内容をセット
- Update() 関数を更新
- WindowSizeMsg で viewport を初期化/サイズ調整
- viewport のイベントを処理
- handleKeyPress() を更新
- j/k キー押下時にプレビューを自動更新
- renderList() を2ペイン表示に変更
- 上部: リスト(動的に調整、カーソル周辺を表示)
- 下部: プレビュー(viewport で表示)
- プレビューヘッダー「📄 Preview」
- internal/ui/styles.go の更新
- PreviewHeaderStyle を追加
機能:
- 2ペイン表示
- 上部: タスクリスト(スクロール可能)
- 下部: Markdownプレビュー(viewport でスクロール可能)
- カーソル移動と連動
- j/k キーでタスク移動時に自動的にプレビューを更新
- Markdownレンダリング
- 見出し、コードブロック、リストなどを美しく表示
- シンタックスハイライト対応
- レスポンシブ対応
- ターミナルサイズに応じて表示領域を調整
使用例:
todo list -d
# - j/k でタスク移動
# - 選択中のタスクがプレビューに表示される
# - Markdownが美しくレンダリングされる
受け入れ基準:
✅ 選択中のタスクのプレビューが下部に表示される
✅ カーソル移動と同時にプレビューが更新される
✅ Markdownが美しくレンダリングされる
✅ 2ペイン表示が適切に配置される
✅ スクロール可能な範囲が表示される
Closes #13
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.
概要
リスト選択モードで下部にMarkdownプレビューを表示し、カーソル移動と連動して更新する機能を実装しました。
関連Issue
Closes #13
依存ライブラリ
github.com/charmbracelet/bubbles/viewportを使用(スクロール可能なプレビュー)変更内容
internal/ui/models.go の更新
render.RenderMarkdown()でMarkdownレンダリングinternal/ui/styles.go の更新
機能
2ペイン表示
カーソル移動と連動
Markdownレンダリング
レスポンシブ対応
使用例
テスト方法
受け入れ基準
チェックリスト
go fmt)