Skip to content

Make extension dialogs draggable - #1212

Closed
uvforce wants to merge 2 commits into
agegr:mainfrom
uvforce:feat/draggable-extension-dialogs
Closed

uvforce wants to merge 2 commits into
agegr:mainfrom
uvforce:feat/draggable-extension-dialogs

Conversation

@uvforce

@uvforce uvforce commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Extension interaction dialogs can cover conversation text that users need to read before answering. Allow users to move the dialog aside without dismissing or collapsing the pending interaction.

 ExtensionDialog / ExtensionCustomPanel
   existing padded overlay
     existing dialog surface
       existing header
+        drag grip, pointer dragging and keyboard movement
       unchanged body and action buttons

Keep the official adaptive width, maximize/restore controls, multiline titles, cancellation, input focus and terminal-key handling. Compose the ordinary dialog's existing sizing ref with the drag ref. Clamp movement to the content region, retain the offset across collapse/restore, and release pointer capture and temporary cursor styles on cancellation, lost capture, blur, hidden state or unmount. Disable dragging at the existing ≤640 px mobile breakpoint; wider touch/pen screens continue to use pointer dragging.

This is a UI-only change with no new settings, persistence, APIs or dependencies. It does not include any automatic-title, sidebar or session-file customization.

Evidence

  • Before: The unmodified v0.12.0 dialog obscures the relevant conversation text.

    After: Dragging the header moves the same dialog aside and reveals the text without submitting another response.

    The comparison uses actual official/modified React components over a synthetic conversation in Chrome, not a model-generated or live extension-RPC session. Screenshots were captured locally but are not attached to this PR.

  • Regression: The hook consumer test covers bounded pointer movement, excluded controls, keyboard/reset actions, collapse/restore, resize, narrow-screen reset and capture/style cleanup. The existing official dialog-fit and extension queue tests are retained.

  • Validation: 14 focused tests pass. The standalone official-base suite has 2627 tests: 2626 pass, 0 fail and 1 skip. ESLint, TypeScript, git diff --check and clean-base git apply --check pass.

Merge Danger

Door: two-way

Reverting restores centered dialogs. Drag offsets are component-local and do not change stored session data or preferences.

Blast Radius: Dialogs

The affected area is the header, focus and positioning lifecycle of ordinary and terminal-style extension dialogs. Body inputs, scrolling and action buttons remain outside the drag-start area; the official mobile breakpoint and sizing behavior are preserved.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T01:07:38.676666Z a7487b9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7487b992c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread components/ChatWindow.tsx Outdated
Comment on lines +1822 to +1823
<div style={{ flexShrink: 1, minHeight: 0, display: "flex", alignItems: "flex-start", gap: 8, padding: "12px 14px", borderBottom: "1px solid var(--border)", maxHeight: "50vh", overflowY: "auto" }}>
<div style={{ flex: 1, minWidth: 0 }}>
<div {...drag.handleProps} style={{ flex: 1, minWidth: 0, display: "flex", alignItems: "flex-start", gap: 8, cursor: drag.enabled ? "grab" : undefined, touchAction: drag.enabled ? "none" : undefined }}>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve touch scrolling in long dialog titles

On touch devices whose viewport is wider than 640 px (so drag.enabled is true), this touchAction: "none" is applied to the child that fills the existing maxHeight: "50vh"; overflowY: "auto" header. A multiline extension title taller than that cap can therefore no longer be panned: the pointer sequence drags the whole dialog instead, leaving the clipped lines unreachable on devices such as an iPad without a mouse. Keep touch panning available for the title scroller, for example by restricting touch dragging to the grip.

AGENTS.md reference: AGENTS.md:L28-L28

Useful? React with 👍 / 👎.

@agegr

agegr commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Thanks @uvforce for the careful work. Clamping, pointer-capture cleanup, collapse/restore and the ≤640px cutoff all behaved as described when I tried them in Chrome.

I'm going to close this one on scope, though. You mention moving the dialog aside without collapsing it. On main the dialog's overlay doesn't take pointer events, so the conversation keeps scrolling behind an open dialog: you can bring the text you need above or below it and answer with both in view. A dialog too tall for that would also be too tall to drag out of the way, and for that case Collapse (#612) keeps the request pending while you read. #699 asked for either collapsing or dragging, and we went with collapsing. Dragging would be a third way to read past the dialog, plus a grip and a grab cursor on every dialog header, which goes against the UI rules in CONTRIBUTING.md. pi's TUI, which we follow for extension UI, has no movable dialogs either.

One side effect I noticed while testing: since any mouse press on the title starts a drag, the title text can no longer be selected or double-clicked to copy. Extensions often put the whole question there, ids and commands included.

If you run into a case that scrolling and Collapse don't cover, please open an issue describing it.

@agegr agegr closed this Oct 14, 2026
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.

2 participants