Skip to content

feat(desktop): TODO 詳細の添付画像を chip 化+プレビュー対応#229

Merged
MocA-Love merged 2 commits intomainfrom
feat/todo-attachment-chip-preview
Apr 16, 2026
Merged

feat(desktop): TODO 詳細の添付画像を chip 化+プレビュー対応#229
MocA-Love merged 2 commits intomainfrom
feat/todo-attachment-chip-preview

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

Closes #228

概要

AgentManager(TodoManager)のタスク詳細画面で、「やってほしいこと」「ゴール」フィールドに添付された画像を chip(クリップマーク + ファイル名) として表示し、クリックで 画像プレビューダイアログ を開けるようにした。プレビューを開いても AgentManager ダイアログは閉じない(ネスト Dialog 動作)。

これまでは session.description / session.goalwhitespace-pre-wrap の素テキストでそのまま表示しており、コンポーザで貼り付けた画像は `` という長いマークダウン文字列として剥き出しになり、クリックしてもプレビューできなかった(要 issue 報告: #228)。

変更点

main プロセス

  • apps/desktop/src/main/todo-agent/trpc-router.ts
    • todoAgent.readAttachment query を追加。userData/todo-agent/attachments/ 配下のパスのみ読み取りを許可し、外側のパスは FORBIDDEN で拒否(path traversal 対策)。base64 + MIME を返す。

renderer プロセス

  • apps/desktop/src/renderer/features/todo-agent/TodoManager/utils/attachmentRefs/
    • `alt` を抽出する extractAttachmentRefs と、本文側から除去する stripAttachmentRefs を追加。POSIX / Windows 両対応の正規表現、saveAttachment が付ける UUID プリフィックスを表示用に除去。
  • apps/desktop/src/renderer/features/todo-agent/TodoManager/components/AttachmentChips/
    • 読み取り専用の chip 一覧。コンポーザの ImagePasteTextarea の chip スタイルと統一(クリップ + ファイル名)。
  • apps/desktop/src/renderer/features/todo-agent/TodoManager/components/AttachmentPreviewDialog/
    • ネスト Dialog で画像をプレビュー。readAttachment で base64 取得して `` で表示。パスコピー導線あり。
  • TodoManager.tsxSessionDetail を改修
    • 「やってほしいこと」「ゴール」表示ブロックで本文を strip した上で chip 列を描画。
    • chip クリックで AttachmentPreviewDialog を開く。
    • セッション切り替え時に previewAttachment をリセット。
    • 編集モード(Textarea)はそのまま raw テキストを編集できる。

スクリーンショット

(動作確認後に追記)

受け入れ条件チェック

  • 既存タスクの詳細画面で、添付された画像が chip として表示される
  • chip クリックで画像が拡大表示され、AgentManager ダイアログは閉じない
  • main 側で添付ディレクトリ外のパスは拒否(FORBIDDEN)
  • bun run lint:fix
  • bun run typecheck

補足

  • 添付検出は /todo-agent/attachments/ を含むパスに限定しており、Linear の画像 URL や data: URL など他の参照には影響しない。
  • Dialogmodal=false(既存 PresetsDialog と同じ)なので、複数ダイアログのオーバーレイが重なっても既存の挙動と一貫。

AgentManager のタスク詳細画面では「やってほしいこと」「ゴール」
フィールドが whitespace-pre-wrap の素テキストだったため、添付画像が
`![](/path/.../todo-agent/attachments/xxx-image.png)` という長い
マークダウン文字列のまま剥き出しで見えていた。コンポーザ
(`ImagePasteTextarea`) のチップ UI と詳細表示の体験を揃える。

- `todoAgent.readAttachment` tRPC procedure を追加。
  `userData/todo-agent/attachments/` 配下のパスのみ読み取りを許可し、
  base64 + MIME を返す。それ以外のパスは FORBIDDEN で拒否。
- 添付参照を抽出する `extractAttachmentRefs` / `stripAttachmentRefs`
  ユーティリティを追加(POSIX/Windows 両対応、UUID プリフィックス除去)。
- `AttachmentChips`(読み取り専用 chip 一覧)と `AttachmentPreviewDialog`
  (ネスト Dialog で画像表示)を追加。
- SessionDetail の description / goal 表示を、本文(strip 済み) +
  チップ列にレイアウト。チップクリックでプレビューを開く。
  AgentManager ダイアログは閉じない(ネスト Dialog として動作)。
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Warning

Rate limit exceeded

@MocA-Love has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 58 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 6 minutes and 58 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 81a271c1-040e-4468-9490-3224f95369c1

📥 Commits

Reviewing files that changed from the base of the PR and between 8c082df and 572774a.

📒 Files selected for processing (9)
  • README.md
  • apps/desktop/src/main/todo-agent/trpc-router.ts
  • apps/desktop/src/renderer/features/todo-agent/TodoManager/TodoManager.tsx
  • apps/desktop/src/renderer/features/todo-agent/TodoManager/components/AttachmentChips/AttachmentChips.tsx
  • apps/desktop/src/renderer/features/todo-agent/TodoManager/components/AttachmentChips/index.ts
  • apps/desktop/src/renderer/features/todo-agent/TodoManager/components/AttachmentPreviewDialog/AttachmentPreviewDialog.tsx
  • apps/desktop/src/renderer/features/todo-agent/TodoManager/components/AttachmentPreviewDialog/index.ts
  • apps/desktop/src/renderer/features/todo-agent/TodoManager/utils/attachmentRefs/attachmentRefs.ts
  • apps/desktop/src/renderer/features/todo-agent/TodoManager/utils/attachmentRefs/index.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/todo-attachment-chip-preview

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 and usage tips.

@MocA-Love MocA-Love self-assigned this Apr 16, 2026
MocA-Love added a commit that referenced this pull request Apr 16, 2026
- scheduler.ts: supervisor.start は同期 wrap で実際には reject しない
  ため、'.catch で failed に倒す' という docstring が嘘だった。docstring
  を実態(不慮の throw を console に出すだけの保護的 catch)に合わせ、
  status 書き換え経路は drain 側の責務に一本化。
- supervisor.ts (extractScheduledWakeup): 範囲外の delaySeconds を
  silent clamp していたが、Claude が想定した再開時刻と実際の再開が
  ずれて挙動が読めなくなる。コメント通り malformed 扱いで wait に
  遷移させない(done の通常終了に倒す)よう修正。
- globals.css (.animate-shine): Stylelint の declaration-empty-line-before
  と value-keyword-case を解消(currentColor → currentcolor、宣言前空行)。
- CommentBody.tsx: rehype-sanitize の defaultSchema が className を
  剥がして remark-github-blockquote-alert の markdown-alert スタイル
  が当たらない問題を修正。markdown-alert / markdown-alert-title /
  octicon クラスのみ明示許可するカスタムスキーマを渡す。
- README.md: #229 の追加日 2026-04-17 → 2026-04-16(他行と同じ
  PR 作成日 UTC 基準)に揃える。
@MocA-Love MocA-Love merged commit 317cf20 into main Apr 16, 2026
14 checks passed
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.

AgentManager: タスク詳細の『やってほしいこと/ゴール』に添付された画像を chip 表示+プレビュー対応

1 participant