feat(web): complete live roster drag for bots and groups - #218
feat(web): complete live roster drag for bots and groups#218leoisadev1 wants to merge 3 commits into
Conversation
The live BotRosterSidebar could reorder sections and rows with hello-pangea, but pins were not a drop target and drag cleanup was incomplete. Port the upstream sidebar pointer, insertion-gap, and motion behavior onto the live bot/group roster without settling chats or changing group membership.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This is Leo's agent. GroupThreadLanding hook-order crash, reproduced on baseline rather than inferred from an untouched file:
Follow-up drag evidence on this branch: Crew group row dragged to the top without navigating away from Mori; mobile sidebar opened and Akeru dragged above Scout in the sheet. |
Greptile SummaryThe roster can show Move up/down controls for newly live unassigned bots or groups that are absent from an existing saved order, but those controls do not update the displayed or saved order. Confidence Score: 4/5Not safe to merge until newly live unassigned roster entries can be reordered by their enabled controls. The reproduced roster failure prevents enabled Move up/down actions from working for newly live unassigned entries omitted from a saved order. The keyboard-reordering thread was manually resolved by greptile-apps[bot] without explanation. The cancelled-drag click-suppression thread was manually resolved by greptile-apps[bot] without explanation. The keyboard-action drag thread was manually resolved by greptile-apps[bot] without explanation. Files Needing Attention: apps/web/src/components/roster/rosterStore.ts
What T-Rex did
|
Greptile found that the live roster registered only a pointer sensor, and that a cancelled drag could leave a capture-phase click suppressor that blocked the next keyboard activation. Register dnd-kit's keyboard sensor and drop that suppressor on keydown.
dnd-kit KeyboardSensor made Enter/Space start a drag on live bot and group rows. Put Move up/down on the existing action menus, and ignore keyboard-generated clicks plus the next keydown in cancelled-drag click suppression. Grok 4.6 in Akeru Bot.
| const unassigned = | ||
| state.unassignedItems.length > 0 | ||
| ? state.unassignedItems.filter(remaining) | ||
| : [ | ||
| ...state.groups.map((group) => ({ kind: "group" as const, id: group.id })), | ||
| ...state.bots | ||
| .filter((bot) => bot.archivedAt === null) | ||
| .map((bot) => ({ kind: "bot" as const, id: bot.id })), | ||
| ].filter(remaining); | ||
| const movedUnassigned = moveRosterItemInOrder(unassigned, item, delta); | ||
| if (!movedUnassigned) return; |
There was a problem hiding this comment.
Unassigned moves silently fail
When a saved nonempty unassigned order does not include a newly live, unpinned, unsectioned bot or group, the sidebar appends that item visually and enables its Move up control. This code instead builds the reorder source from only the saved list, so it cannot find the new item and returns without updating or saving anything. The enabled control silently does nothing, leaving users unable to reorder newly discovered unassigned entries.
Artifacts
- This authored TypeScript script initializes the persisted and newly live unassigned roster scenario, invokes the real store action, and records the resulting state; it directly exercises the affected behavior.
- The completed command output shows Move up enabled for Bravo while persisted order and persistence writes remain unchanged after invoking the real nudge action; the supplied issue is confirmed.
- This command output confirms the temporary source-tree browser harness was removed before reporting; no temporary source harness remains.
Problem
The live Akeru roster (
BotRosterSidebar) used@hello-pangea/dnd. Pins were a display-only strip, not a sortable destination. Drag cleanup did not cover Escape, blur, hidden tab, unmount, or a missed release. Insertion-gap motion, destination labels, and empty/collapsed targets from upstream thread-sidebar drag never reached the live bot/group UI.Change
Adapt upstream sidebar drag onto the live roster, not the dead
Sidebar.tsx.detail === 0) and clears on the next keydownLayout is still browser-local per environment. Server-backed roster order, sidebar file drops, and native arrange are follow-up PRs.
Upstream
Reviewed adaptations of pingdotgg/t3code:
Scope checklist
activeOrder)Verification
vp test runon roster logic/store/drag/pointer/motion plus SidebarChrome and shortcut guards: 96 passedvp lintandvp run --filter @t3tools/web typecheckon the changed files: cleanvp run dev --home-dir /tmp/akeru-roster-drag.VVPXZ4with pairing/bots/...); the drag did not navigate.ceb469ba2): Actions menu Move up on Mori (Crew, Mori, Scout, Akeru), Move down on Crew (Mori, Crew, Scout, Akeru). Enter on the Akeru row opened Akeru chat; Enter on Crew opened the group chat (no KeyboardSensor drag). Pointer-drag Scout, Escape cancel, then Enter on Akeru still opened Akeru. Blur cancel, then Actions Move down on Mori (Crew, Mori, Scout, Akeru). Hidden/visibility cancel without pointerup, then Enter on Scout still opened Scout.GroupThreadLanding hook crash (baseline)
Opening
/groups/...still hitsRendered more hooks than during the previous renderinGroupThreadLandingatuseReplyPlaybackThread(line 96), afterif (!group) return null(line 90).Isolated baseline proof, not “the file was untouched”:
apps/web/src/components/roster/GroupThreadLanding.tsxis identical onorigin/main, this worktree, and PR 218 HEAD:a2c27563b420e122f83e658567071580e773fe0b. Last change:4314798bd feat(web): add Read aloud for stored bot replies (#194).fix/group-reply-playback-hook-order,ThreadLanding.hookOrder.test.tsx) against that baseline file without applying fix(web): keep reply playback hooks stable during chat hydration #202’s fix. All three cases failed with the same error: missing bot, archived bot, and missing group then hydrated group. Group failure stack:GroupThreadLanding.tsx:96→useReplyPlaybackThread.roster-drag.webm
Limitations
window.prompt.Grok 4.6 High in Grok Build via Orca.