Skip to content

fix(web): prevent drawer close on text drag#440

Merged
seakee merged 3 commits into
mainfrom
fix/drawer-overlay-drag-close
Jul 24, 2026
Merged

fix(web): prevent drawer close on text drag#440
seakee merged 3 commits into
mainfrom
fix/drawer-overlay-drag-close

Conversation

@seakee

@seakee seakee commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

Fix Drawer overlay false close when users drag-select text from inputs onto the mask. Only close when pointer down and up both land on the overlay itself, and add unit coverage for the three press/release paths.

Scope

  • Frontend panel
  • Manager Server
  • CPA panel mode
  • Full Docker mode
  • Native packages / release
  • Docs / Wiki
  • CI / build / tooling

Changes

  • Replace Drawer overlay onClick close with pointer down/up pairing
  • Keep close button and Esc behavior unchanged
  • Add Drawer unit tests for overlay press/release vs drag-out cases

User Impact

Provider edit drawers and other Drawer consumers no longer close accidentally when users drag-select text from inputs onto the overlay. Intentional overlay click-to-close still works.

Compatibility / Runtime Notes

  • CPA panel mode: frontend-only Drawer behavior; no CPA runtime/API change
  • Manager Server mode: frontend-only; no server contract change
  • Full Docker / native packages: same embedded frontend behavior after rebuild/release

Data / Security Notes

N/A — no SQLite, credential, auth file, log, raw usage data, or plugin changes.

Risk / Rollback

Risk level: Low

Rollback notes:

  • Revert this PR to restore previous overlay onClick close behavior
  • No data migration or config change required

Verification

  • Type check
  • Lint
  • Tests
  • Build
  • Manual UI check
  • Docs/link check
  • Not applicable, docs-only

Commands / evidence:

npm --workspace apps/web run test -- src/components/ui/Drawer.test.tsx
# Test Files  1 passed (1)
# Tests  3 passed (3)

Screenshots / Recordings

N/A — interaction fix only; no visual layout change. Recommended manual check:

  1. Open provider edit drawer
  2. Drag-select text from an input onto the overlay → drawer stays open
  3. Click overlay background → drawer still closes

Docs

  • README / README_CN updated for user-visible capabilities
  • Matching docs manual and navigation updated
  • Demo fixtures, screenshots, and deep links reviewed
  • Release notes needed
  • Not needed — explanation included below

Docs decision:
Bugfix for existing Drawer close interaction; no new capability, config surface, or docs path change.

Related

Closes #437

seakee added 3 commits July 24, 2026 17:44
Only close the drawer when pointer down and up both
land on the overlay itself. Stops accidental close when
users drag-select text from inputs onto the mask.

Covers provider edit drawers and other Drawer consumers.
Track overlay pointer presses by pointerId so multi-touch
interleaving cannot close the drawer incorrectly.

Also unmount renderers and restore DOM globals between tests.
Use () => void for mountDrawer's onClose parameter so tsc
accepts vi.fn() mocks against DrawerProps.
@seakee
seakee merged commit 42e0672 into main Jul 24, 2026
9 of 10 checks passed
@seakee seakee mentioned this pull request Jul 24, 2026
19 tasks
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.

[Bug]: 自动退出

1 participant