feat(desktop): default markdown files to preview view#3860
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe markdown preview view's priority setting is elevated from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Greptile SummaryThis PR bumps Confidence Score: 5/5Safe to merge — the single-line change is correct and consistent with how other views (e.g., BinaryWarningView) already use "default" priority. The change is minimal and mechanically correct: "default" (rank 4) > "builtin" (rank 3), so resolveViews will place markdownPreviewView first for .md files. Per-pane viewId persistence means existing raw-view preferences are unaffected. No logic issues or edge cases were found. No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/registry/views/MarkdownPreviewView/index.ts | One-line priority bump from "option" (rank 1) to "default" (rank 4), correctly making the preview view sort above codeView (rank 3) for markdown files |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Open .md file] --> B{resolveViews}
B --> C[Filter matching views]
C --> D{Any exclusive?}
D -- Yes --> E[Return exclusives only]
D -- No --> F[Sort by PRIORITY_RANK desc]
F --> G["markdownPreviewView\n(default = 4)"]
F --> H["codeView\n(builtin = 3)"]
G --> I[pickDefaultView → index 0]
I --> J{Per-pane viewId persisted?}
J -- Yes --> K[Use persisted viewId]
J -- No --> L[Open in Preview ← NEW default]
Reviews (1): Last reviewed commit: "feat(desktop): default markdown files to..." | Re-trigger Greptile
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
markdownPreviewViewpriority fromoptiontodefaultso markdown files open in the rendered preview by default instead of raw source.viewIdis already persisted, so anyone who toggles to raw stays on raw for that pane; only fresh pane opens are affected.Test plan
.mdfile from the v2 file tree → renders in preview by default.mdfile → also defaults to previewSummary by cubic
Markdown files now open in the rendered Preview by default. We set the
markdownPreviewViewpriority todefault; per-pane view choice persists, so switching to Raw keeps Raw for that pane while new panes still default to Preview.Written for commit e5d1b59. Summary will update on new commits. Review in cubic
Summary by CodeRabbit