Skip to content

feat(app): add dropped file tab option#588

Open
murongg wants to merge 2 commits into
v2from
feature/576-file-drop-tabs
Open

feat(app): add dropped file tab option#588
murongg wants to merge 2 commits into
v2from
feature/576-file-drop-tabs

Conversation

@murongg

@murongg murongg commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an opt-in General setting to open dropped Markdown files as tabs in the current window
  • preserve the current workspace tree when a dropped file replaces an empty tab, and reuse that tab instead of leaving a blank one behind
  • open dropped folders in a new window whenever another tab contains work, preventing hidden tabs from being cleared
  • keep the existing new-window default for dropped files
  • persist and normalize the preference, with translations for all 11 supported languages

Why

Opening a file currently establishes its containing folder as a workspace, so the new-window behavior is intentional. This option supports the requested tab workflow without changing the default workspace model or discarding existing tab state.

Validation

  • pnpm --filter @markra/shared test — 7 test files and 62 tests passed
  • pnpm --filter @markra/shared build — passed
  • pnpm --filter @markra/app exec vitest run src/hooks/useMarkdownDocument.test.tsx — 82 tests passed
  • pnpm --filter @markra/app typecheck:test — passed
  • pnpm --filter @markra/app test — 127 test files and 1445 tests passed
  • pnpm --filter @markra/desktop build — production build and 15 vendor chunk imports passed
  • verified all 3 new i18n keys are present in 11/11 locale files

Risk

  • the tab behavior only activates when both the new preference and document tabs are enabled; otherwise Markra keeps the existing new-window behavior
  • a fresh empty window still establishes a workspace from its first dropped file
  • a dropped folder reuses the current window only when every open tab is empty
  • existing settings require no migration because missing values normalize to false

Closes #576

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markra-web Ready Ready Preview, Comment Jul 26, 2026 1:25pm

Preserve existing workspace state when dropped files replace empty tabs, and route folder drops to a new window when other tabs contain work.

Refs #576
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.

[Feature]: 建议拖放文件在新当前窗口的新标签页中打开

1 participant