Skip to content

feat(web): drag files and chat links onto right-panel panes - #249

Merged
orbitingflea merged 1 commit into
mainfrom
feat/drag-link-to-panel
Nov 22, 2026
Merged

orbitingflea merged 1 commit into
mainfrom
feat/drag-link-to-panel

Conversation

@orbitingflea

@orbitingflea orbitingflea commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

This pull request makes Files-tree files and chat links draggable onto right-panel panes, so users can open them directly in a chosen pane, tab slot, or split.

改了什么行为

Behaviour change: yes, a web or desktop user who drags a Files-tree file or a supported chat link onto a right-panel pane opens it in that pane, at a tab-strip slot, or in a new split on the left or right third of a single pane.

  • Sources. Files-tree file rows and chat links for files, full pull request and issue URLs, threads, board://, Dashboard, and web URLs (web URLs open in the preview browser).
  • Placement. Pane content shows a box ghost, a tab strip shows a slot marker, and the outer thirds of a single pane with room to split widen the panel with a half-panel ghost. An item open in the other pane moves over, and that pane keeps a tab. Dropped files keep a standalone Files tab open, and file links keep their line number.
  • Boundaries. Pull request or issue URLs open in the app if clicks do. Other web links drag only with preview, even if clicks leave the app. A dropped file link opens what its click opens, folders, images, or videos too. Files-tree folders, #42, commit, and web image or video URLs do not drag. Files @mention (side chats too), text, tab, and Mac or Windows file-chip drags stay unchanged. Clicks or keys cancel a slow open.

Checks

  • Unit tests, 15 browser tests, and the changed-files check passed.
  • Checked in Chromium on the web app at desktop and phone widths (361x662).
  • Not checked: desktop Electron app, Firefox, and Safari.
Implementation details, checks, and screenshots

Implementation

  • Fork files in apps/web/src/fork/rightPanelSplit/ hold the drag marker (panelLinkDrag.ts), drop planning (linkDrop.logic.ts), drop target (PanelLinkDropScope.tsx), and source rules (linkSources.ts, chatAnchorLink.ts).
  • Upstream adds drag-start hooks on chat links, file chips, thread chips, and Files rows, keepExplorer on openFile (rightPanelStore.ts), data-right-panel-tab-id on tabs, and issueLinkTarget (openIssueLink.ts) shared by click and drag. The chat renderer passes its preview opener into chatAnchorLink.ts, which reads the opened tab and reports failures in fork code. fileChipPanelLink holds the file-chip drop rule in the fork and needs only a thread and panel path, as clicks do.
  • Each source open returns the tab it opened at that moment, so the panel places that tab rather than whichever tab is active after a slow open.
  • Each drag carries a private MIME marker. The panel checks it on drag-over and claims drops in the bubble phase, so claiming children (like a message box) keep them. While armed, data-panel-link-drag applies panelLinkDrag.css (pointer-events: none !important) to panel frames and the fixed desktop preview layer above the pane, overriding its inline pointer-events: auto so drops reach the pane.
  • Plain file clicks still replace a Files tab. Pull request tabs need "pull request links open in app" and a repo match. Issue tabs need issues on and a project match.
  • English UI only. Revert the commit to undo this change. There is no server or data change.

Checks run

  • Changed-files check. Format, lint, knip, typecheck, and tests beside changes passed.
  • Unit tests. Drop planning (linkDrop.logic.test.ts), source rules (linkSources.test.ts), store tests, and file-tree mention tests (fileTreeDragMention.test.ts).
  • Browser tests. 15 tests in RightPanelSplitView.browser.test.tsx cover real drags: an iframe pane, a preview-like layer with inline pointer-events: auto, tab-strip slots, a side-chat mention drop, non-claiming targets, a slow open cancelled by a press, and a slow open placing its own tab when another open activates a tab first. Desktop Electron stays unchecked by hand, so only this Chromium test covers the new rule.
  • Web app checks in Chromium. Checked a chat file chip splitting the right third, a web link opening on a tab strip, an already-open chip moving from the other pane, a Files row over a preview browser pane, a Files row splitting its own tree's right third while keeping Files, Files rows adding @mention in main and side-chat message boxes, a web link over an HTML iframe, unchanged tab dragging, and the ghost at phone width (361x662).

Screenshots

File chip split
Desktop. A chat file chip dropped on the right third split the panel.

Tab strip ghost
Desktop. A ghost marker on a tab strip during a drag.

Side chat mention
Desktop. A Files row dropped on a side chat's message box inside the panel added a mention.

Phone ghost
Phone width. A ghost box over the panel during a drag.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 22, 2026
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 6a033d0.

This comment will update automatically after the next completed run.

@orbitingflea
orbitingflea force-pushed the feat/drag-link-to-panel branch from ac51a4b to dd58207 Compare November 22, 2026 02:15
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

This PR changes the test suite by +21 test cases (browser +6, unit +15, server 0).

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

…dropped on

Dragging a Files row or a chat link (file, pull request, issue, thread,
board, Dashboard or web link) onto a right-panel pane opens it there. A
drop on a tab strip opens it at that slot, and the outer thirds of a
single pane split the panel with the link on that side, as a tab drag
does. Each source keeps its own open; the panel places the surface that
open activates. The composer @mention drop, also in a side chat inside the
panel, and tab dragging are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant