Skip to content

feat(hub-ui): reorder tools in the group sidebar - #499

Merged
antfu merged 2 commits into
mainfrom
feat/reorder-tool-group-icons
Nov 19, 2026
Merged

antfu merged 2 commits into
mainfrom
feat/reorder-tool-group-icons

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Summary

The order of tools in the group sidebar was fixed. Users could only change it on the Settings > Docks page.

Now users can reorder tools directly in the group sidebar:

  • Drag a tool up or down. A line shows where it will land.
  • Or focus a tool and press Alt+ArrowUp / Alt+ArrowDown.

A tool moves only inside its own sub-category, the same rule as the settings page. The order is saved to the existing docksCustomOrder user setting, so the sidebar, the dock bar and the settings page stay in sync. No new setting.

The logic that turns a new order into docksCustomOrder writes moves from SettingsDocks.vue to state/dock-settings.ts (resolveCustomOrderPatch, applyCustomOrderPatch), and the sidebar uses resolveGroupMemberMove on top of it. Hidden members count in the move, so their saved place stays stable.

The drag uses pointer capture, so it keeps working when the pointer crosses the panel iframe. The click that ends a drag does not open the tool.

Visual changes

Before After
Absent Group sidebar mid-drag
No drag reorder Ping (faded) dragged above Pong; the primary line marks the drop slot

Captured from the packages/hub-ui playground, 1280x577, with a temporary third member ("Pong") added to the seed so two members share a sub-category. That seed change is not part of this PR. Icons show as placeholders because the browser was offline.

User prompts

  • Model: claude-opus-5-5, harness: Claude Code (in Paseo)
  • Asked to let users rearrange the tool icons in the tool group panel, because their order was fixed.
  • Chose to create a PR.

Verification

  • pnpm vitest run packages/hub-ui - 17 files, 172 tests passed (new tests for resolveCustomOrderPatch and resolveGroupMemberMove in dock-settings.test.ts).
  • pnpm lint, pnpm typecheck, pnpm knip, pnpm build - pass.
  • Manual check in the playground with agent-browser:
    • Dragging Ping onto Pong changed the order to Ping, Pong. The order survived a reload.
    • Alt+ArrowDown on focused Ping moved it below Pong and kept focus on it.
    • Dragging between sub-categories does nothing, as intended.
  • Not checked: the group popover from the dock bar (not changed), touch devices, popup dock mode.

This PR was written by an agent. The human gave the task and has not reviewed the diff yet.

Drag a tool up or down in the group sidebar, or press Alt+ArrowUp /
Alt+ArrowDown on it, to change its place inside its sub-category. The
order is saved to docksCustomOrder, the setting Settings > Docks edits.
The patch logic moves to dock-settings so both surfaces share it.
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
devframe Ready Ready Preview Nov 19, 2026 1:22am UTC

@github-actions

Copy link
Copy Markdown

👁️‍🗨️ Review this pull request with grouped, summarized diffs at:
👉 https://pulls.review/gh/devframes/devframe/499?from=github-actions[bot]

raw result

💭 analyzed by vercel-ai-gateway/anthropic/claude-sonnet-5
🕰️ 2026-11-19 01:22 UTC
🔗 head b933a16
🤖 automated by pulls.review

{
  "headSha": "b933a16e8ede2f82e4b3c1563cd1276155307272",
  "result": {
    "overallSummary": "Adds drag-and-drop and keyboard (Alt+ArrowUp/Down) reordering of tools in the group sidebar, reusing and extending the `docksCustomOrder` logic already used by the Docks settings page so both stay in sync.",
    "groups": [
      {
        "key": "reorder-logic",
        "label": "Reorder logic",
        "summary": "Extracts the move-to-`docksCustomOrder` logic (`resolveCustomOrderPatch`, `applyCustomOrderPatch`) out of `SettingsDocks.vue` into shared helpers, and adds `resolveGroupMemberMove` which computes the patch for moving one group member next to another within its sub-category, keeping hidden members' saved positions stable.",
        "category": "core",
        "filePaths": [
          "packages/hub-ui/src/client/state/dock-settings.ts"
        ],
        "critical": true
      },
      {
        "key": "sidebar-reorder-ui",
        "label": "Sidebar drag/keyboard reorder",
        "summary": "Adds pointer-capture based drag reordering (with a drop-line indicator) and Alt+ArrowUp/ArrowDown keyboard reordering to the group sidebar, using the new shared order-patch helpers; also updates the Docks settings page to use these same helpers instead of its own inline logic.",
        "category": "ui",
        "filePaths": [
          "packages/hub-ui/src/client/components/dock/DockGroupSidebar.vue",
          "packages/hub-ui/src/client/components/views-builtin/SettingsDocks.vue"
        ],
        "fileNotes": [
          {
            "path": "packages/hub-ui/src/client/components/dock/DockGroupSidebar.vue",
            "text": "Uses pointer capture so drags survive crossing the panel iframe, and a `suppressClick` flag so the click ending a drag doesn't open the tool."
          }
        ]
      },
      {
        "key": "tests",
        "label": "Reorder tests",
        "summary": "Adds unit tests for `resolveCustomOrderPatch` and `resolveGroupMemberMove`, covering moving up/down, restoring the default order, hidden members, and refusing cross-sub-category moves.",
        "category": "tests",
        "filePaths": [
          "packages/hub-ui/src/client/state/dock-settings.test.ts"
        ]
      },
      {
        "key": "docs",
        "label": "Docs update",
        "summary": "Documents the new drag/keyboard reordering behavior for users, alongside the existing pin/recent docs.",
        "category": "docs",
        "filePaths": [
          "docs/content/1.guide/16.hub.md"
        ]
      }
    ],
    "schemaVersion": 1,
    "source": "llm",
    "generatedAt": "2026-11-19T01:22:20.035Z",
    "model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
    "locale": "en"
  }
}

@antfu
antfu merged commit abe2626 into main Nov 19, 2026
8 of 16 checks passed
@antfu
antfu deleted the feat/reorder-tool-group-icons branch November 19, 2026 01:24

This branch was successfully deployed

1 active deployment
Preview — b933a16e Deployed Nov 19, 2026 by vercel[bot]
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