Fix chat title generation, copying, and note markdown styling#579
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughQueued completion title generation now uses message-aware eligibility checks, copied chat content removes internal tool-call blocks, and note editor Fleather styling is centralized across rich-text elements. Regression tests cover all three behaviors across chat, clipboard, and light/dark note rendering scenarios. ChangesQueued title generation
Clipboard sanitization
Note editor theming
Estimated code review effort: 3 (Moderate) | ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches✨ Simplify code
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/shared/widgets/markdown/markdown_preprocessor.dart`:
- Around line 196-199: Update the preprocessing flow around _replaceOutsideCode
to mask inline and fenced code spans with placeholders before removing
_toolCallBlocks, then restore only placeholders that remain after removal.
Preserve the existing newline normalization and trimming behavior, and add a
regression case covering a tool-call block containing both inline and fenced
code.
In `@test/regressions/issues_511_576_577_test.dart`:
- Around line 24-27: Replace the `expect` assertion in the regression test with
the `package:checks` `check(...).equals(...)` API, and update any other
assertions in this new test file similarly while preserving the existing
expected values and test behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: b9f6288a-4ec9-417c-86fd-5103b6dfcb89
📒 Files selected for processing (5)
lib/features/chat/providers/chat_providers.dartlib/features/chat/views/chat_page.dartlib/features/notes/views/note_editor_page.dartlib/shared/widgets/markdown/markdown_preprocessor.darttest/regressions/issues_511_576_577_test.dart
Fixes Applied SuccessfullyFixed 4 CodeRabbit feedback items across 3 files. Files modified:
Commits: The latest autofix changes are on the |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/shared/widgets/markdown/markdown_preprocessor.dart`:
- Line 67: Update the _codeSpanOrFence regular expression to capture one or more
backticks and close with the same captured delimiter via a backreference, so
inline spans and fences of any backtick length are matched correctly.
- Around line 338-364: Generalize the existing masking logic into a
_removeMatchesOutsideCode helper that accepts the input and target pattern,
preserving code spans and fenced blocks while removing only matches outside
them. Delete _replaceOutsideCode, then update removeAllDetails,
_stripLinkReferenceDefinitions, sanitize, and sanitizeForClipboard to use the
new helper for _allDetailsBlocks, _linkReferenceDefinition, _reasoningBlocks,
and _toolCallBlocks respectively.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: fb382f87-1174-4f79-925f-30a206800f27
📒 Files selected for processing (2)
lib/shared/widgets/markdown/markdown_preprocessor.darttest/regressions/issues_511_576_577_test.dart
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Verification
dart run build_runner buildflutter analyzeflutter test(4,008 passed, 2 existing skips)Fixes #577
Fixes #576
Fixes #511
Note
Fix chat title generation, clipboard sanitization, and note editor markdown styling
_shouldGenerateQueuedTitletriggers title and tags background tasks only on the first user turn of non-temporary conversations, replacing a hardcodedfalse.sanitizeForClipboardtoConduitMarkdownPreprocessorwhich strips tool-call<details>blocks while preserving ordinary details and tool-call examples inside code spans/fences.sanitize,removeAllDetails, and_stripLinkReferenceDefinitionsto operate only outside code spans/fences via a new_removeMatchesOutsideCodehelper, preventing accidental removal of literal examples in code.note_editor_page.dartto apply consistent colors and typography for headings, lists, quotes, code, and links using the app's semantic color tokens.issues_511_576_577_test.dartcovering clipboard sanitization, queued title generation logic, and note editor theme colors in light and dark modes.Macroscope summarized c810559.
Summary by CodeRabbit
Greptile Summary
This PR fixes chat title generation, message copying, and rich note markdown styling. The main changes are:
Confidence Score: 5/5
Safe to merge with low risk.
The changes are targeted to the reported regressions and keep existing guards for temporary chats and later chat turns. Tests cover the updated markdown, queued-completion, and note-theme behavior. No blocking correctness or security issues were identified in the changed paths.
No files require special attention.
What T-Rex did
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant User participant ChatPage participant Preprocessor participant Queue as Queued/Headless Completion participant OpenWebUI participant Notes as Note Editor User->>ChatPage: Copy assistant message ChatPage->>Preprocessor: sanitizeForClipboard(content) Preprocessor-->>ChatPage: Markdown without internal tool-call details ChatPage-->>User: Clipboard text Queue->>Queue: Locate target assistant placeholder Queue->>Queue: Count prior user turns alt first non-temporary turn Queue->>OpenWebUI: sendMessageSession(backgroundTasks: title/tags) else later or temporary turn Queue->>OpenWebUI: sendMessageSession(without title/tags) end User->>Notes: Open rich note editor Notes->>Notes: buildNoteEditorFleatherTheme(context) Notes-->>User: Semantic colors for headings, lists, quotes, and code%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant User participant ChatPage participant Preprocessor participant Queue as Queued/Headless Completion participant OpenWebUI participant Notes as Note Editor User->>ChatPage: Copy assistant message ChatPage->>Preprocessor: sanitizeForClipboard(content) Preprocessor-->>ChatPage: Markdown without internal tool-call details ChatPage-->>User: Clipboard text Queue->>Queue: Locate target assistant placeholder Queue->>Queue: Count prior user turns alt first non-temporary turn Queue->>OpenWebUI: sendMessageSession(backgroundTasks: title/tags) else later or temporary turn Queue->>OpenWebUI: sendMessageSession(without title/tags) end User->>Notes: Open rich note editor Notes->>Notes: buildNoteEditorFleatherTheme(context) Notes-->>User: Semantic colors for headings, lists, quotes, and codeReviews (3): Last reviewed commit: "fix: harden markdown code masking" | Re-trigger Greptile