feat(ui): improve log note saving and commit prefill for log notes#407
feat(ui): improve log note saving and commit prefill for log notes#407
Conversation
Wrap command output in code blocks when saving as a note, and prefill the new commit dialog with "Look for issues in the logs in the latest note" when the last timeline item is a note ending with " log". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use .toLowerCase().endsWith() for consistency with the existing plan title check above. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change the prefill to "Read the latest note which contains logs. Look for any issues." for clearer intent. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 914ca9cf4b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| saveError = null; | ||
| const title = `${actionName} log`; | ||
| await createNote(branchId, title, content); | ||
| await createNote(branchId, title, '```\n' + content + '\n```'); |
There was a problem hiding this comment.
Escape fenced log output before wrapping it in markdown
If an action log already contains ``````, wrapping the whole payload in another triple-fenced block here produces malformed markdown. NoteModal.svelte renders notes with `marked`, so the first embedded fence closes the wrapper early and the remainder of the saved log is rendered as normal markdown instead of preserved verbatim. This is easy to hit with AI/CLI output that already includes fenced snippets, so some saved logs will open with truncated or reformatted content.
Useful? React with 👍 / 👎.
| if (latest.kind === 'note' && latest.title.toLowerCase().includes('plan')) { | ||
| return 'Implement plan'; | ||
| } | ||
| if (latest.kind === 'note' && latest.title.toLowerCase().endsWith(' log')) { |
There was a problem hiding this comment.
Match log-note titles before the broader plan heuristic
Because action names are user-defined, a saved log note can legitimately be titled something like Migration Plan log. In that case the earlier includes('plan') branch wins, so the new log-note prefill never runs and commit sessions are prefilled with Implement plan instead of the log-analysis prompt. This makes the added behavior fail for any action name containing “plan”.
Useful? React with 👍 / 👎.
Summary
Test plan
🤖 Generated with Claude Code