Skip to content

feat(native): complete SB-DRAG parity and #293 scroll stability - #355

Merged
rynfar merged 2 commits into
nativefrom
nw/242-sb-drag-done
Nov 13, 2026
Merged

rynfar merged 2 commits into
nativefrom
nw/242-sb-drag-done

Conversation

@rynfar

@rynfar rynfar commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Closes #293
Ref #242

Problem

SB-DRAG in apps/native remained partial across thread drag gates, scroll preservation, manual project reordering, external file drops, and ledger evidence:

  • Starting a thread drag set SidebarPane.drag after state.update(...) emitted AppEvent::Shell, so sync_list_rows missed self.drag.is_some() and lost scroll-top stability when the Pinned/Settled drop markers spliced in at row 0 (parity: fix(web): dragging a sidebar thread no longer scrolls the list out from under the pointer (pingdotgg/t3code#30346) #293).
  • Single-env and scoped thread drags lacked can_operate / config_loaded / scoped_ready(..., ORCHESTRATION_OPERATE_SCOPE) checks and mid-drag cancellation on live permission/working transitions, and active-to-active manual drops in time-ordered sort needed DropPlan::None.
  • Manual project group reordering in repository/manual sort mode and external file drops onto sidebar/search thread rows needed full scoped parity and GPUI end-to-end tests.

Fix

  • Scroll stability & drag UI (crates/app/src/sidebar/{drag,mod,controller,bulk}.rs): Set self.drag before state.update(...) (resetting on !started) so sync_list_rows preserves ListOffset { item_ix: 0, offset_in_item: px(0.) } across marker splice; add .min_h_0() + pb(px(40.)) during drag; enforce can_operate / config_loaded / scoped_ready gates and cancel active drags cleanly if permissions or section eligibility change mid-drag; handle active-to-active drop in time-ordered sort (crates/core/src/sidebar/drag.rs).
  • Project group reorder (crates/core/src/sidebar/grouping.rs, crates/app/src/sidebar/{bulk,project_folders,mod}.rs): Add band-preserving (pinned / regular / archived, excluding scratch) resolve_project_drop_target and reorder_project_groups for manual project sort, wired to reorder_scoped_project + drag/drop UI handlers.
  • External file drops (crates/app/src/app_state.rs, crates/app/src/omitted_rows.rs, crates/app/src/composer/{attachments,mod}.rs, crates/app/src/sidebar/{row,search}.rs): Scope external file drops by ThreadKey (pending_composer_file_drop), forward single/scoped drops through search and sidebar rows, clear non-matching pending drops on route change, and flush composer attachments safely.
  • Snapshot & GPUI tests (crates/app/src/snapshot.rs, crates/app/src/sidebar/drag_tests.rs): Add --drag-hold gesture to snapshot.rs; add 4 GPUI tests in drag_tests.rs covering scroll stability + Settled overflow reveal, drag permission/settlement gating & mid-drag cancellation, manual project reorder persistence, and external file drop key isolation.
  • Ledger (apps/native/parity/LEDGER.md): Mark SB-DRAG done (16/16 SB-*).

Visual Evidence (--drag-hold)

Draft release: https://github.com/rynfar/t3code/releases/tag/untagged-e2929fc13c9e34ebb82b

Both offscreen captures show the live --drag-hold ThreadDragPreview card ([Pin] badge), highlighted Pinned boundary marker, dimmed source row, collapsed Settled 0 >, and dashed Settled placeholder.

Verification (run on exact HEAD a74d2b4102691fdd4b52e8eb420b31f16da53ccc, isolated T3_NATIVE_HOME per invocation)

  • cargo clippy --workspace --all-targets -- -D warnings: pass (0 errors, 0 warnings)
  • cargo build -p t3-native & cargo build -p t3-native --features snapshot: pass
  • cargo test -p t3-core -p t3-client: t3-core 1298 passed, 0 failed (unit) + 8 passed, 0 failed (integration); t3-client 105 passed, 0 failed
  • cargo test -p t3-client --features test-support: 113 passed, 0 failed
  • cargo test -p t3-native --features snapshot --bin t3-native:
    • sidebar:: (--test-threads=1): 40 passed, 0 failed (includes 4 new drag_tests::)
    • composer:: (--test-threads=1): 6 passed, 0 failed
    • context_menu::thread_menu_tests:: (--test-threads=1): 11 passed, 0 failed
    • omitted_rows::tests:: (--test-threads=1): 6 passed, 0 failed
    • scoped_route_tests:: (--test-threads=1): 3 passed, 0 failed
  • Node/TS checks: gen-theme.ts --check pass, node --test apps/native/parity/sync.test.ts 42/42 passed, conformance/generate.ts --check pass, vp fmt --check apps/native/parity/LEDGER.md pass
  • vp run check:changed fork/native: pass (format, 40/40 package typecheck, 2/2 tests)

Model/harness: Antigravity (Claude)

Re-anchors scrolled sidebar list offsets across double-ended splices so starting or ending a thread drag while scrolled preserves the visible anchor instead of jumping to index 0, lets explicit omitted-thread navigation and file drops select over an open thread or draft while scoping drop clears by environment, consumes unattachable drops on arrival, and wires project-drag hover/drop cleanup onto Scratch.

Fix verified headless in apps/native with RED->GREEN regressions under sidebar::drag_tests:: plus clippy, workspace builds, core/client suites, and check:changed.

Model: Antigravity (Claude Sonnet 4.6)
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