Skip to content

feat(desktop): default markdown files to preview view#3860

Merged
Kitenite merged 1 commit into
mainfrom
default-file-preview
Apr 29, 2026
Merged

feat(desktop): default markdown files to preview view#3860
Kitenite merged 1 commit into
mainfrom
default-file-preview

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Apr 29, 2026

Summary

  • Bump markdownPreviewView priority from option to default so markdown files open in the rendered preview by default instead of raw source.
  • Per-pane viewId is already persisted, so anyone who toggles to raw stays on raw for that pane; only fresh pane opens are affected.

Test plan

  • Open a .md file from the v2 file tree → renders in preview by default
  • Toggle to raw view → stays on raw across re-focus and tab switching for that pane
  • Open a different .md file → also defaults to preview
  • Non-markdown text files still open in CodeView

Summary by cubic

Markdown files now open in the rendered Preview by default. We set the markdownPreviewView priority to default; 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

  • Improvements
    • Markdown preview is now the default view when opening markdown files, streamlining file viewing workflow.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8b1e75aa-33a2-481d-b8f7-bb69fe633252

📥 Commits

Reviewing files that changed from the base of the PR and between 6cb2099 and e5d1b59.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/registry/views/MarkdownPreviewView/index.ts

📝 Walkthrough

Walkthrough

The markdown preview view's priority setting is elevated from "option" to "default" in the file pane registry, adjusting its selection hierarchy among available file views within the dashboard workspace interface.

Changes

Cohort / File(s) Summary
Markdown Preview View Configuration
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/registry/views/MarkdownPreviewView/index.ts
Updated markdownPreviewView pane priority from "option" to "default", modifying its prioritization relative to other file views.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A markdown view hops to the fore,
From option to default, evermore!
The pane registry dances with glee,
Priority's set where it ought to be! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: setting markdown files to default to preview view instead of raw source.
Description check ✅ Passed The description covers the summary, test plan, and includes auto-generated summary; however, it lacks the structured template sections like 'Related Issues', 'Type of Change', and 'Additional Notes'.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch default-file-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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 29, 2026

Greptile Summary

This PR bumps markdownPreviewView.priority from "option" to "default", making .md files open in the rendered preview by default. The change is correct: the PRIORITY_RANK map scores default at 4 vs builtin at 3 (used by codeView), so resolveViews will now sort the preview view first and pickDefaultView returns it as the initial selection.

Confidence Score: 5/5

Safe 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.

Important Files Changed

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]
Loading

Reviews (1): Last reviewed commit: "feat(desktop): default markdown files to..." | Re-trigger Greptile

@Kitenite Kitenite merged commit 382ac7f into main Apr 29, 2026
6 of 7 checks passed
@Kitenite Kitenite deleted the default-file-preview branch April 29, 2026 17:28
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch

Thank you for your contribution! 🎉

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.

1 participant