fix(desktop): keep new sidebar groups at their source position

Merged
KI
3mo ago
+211-94

What & why

Creating a sidebar group from a workspace now places the group at the source workspace's position instead of appending it. Bulk creation uses the earliest selected position; an already-grouped workspace creates a sibling group directly after its current group. Project workspaces and sessions share this behavior.

Add Create new group at the bottom of the single-workspace and bulk move menus, including when no groups exist. Keep group actions together and put Pin alongside Rename. Translate the new label in every shipping locale.

Updated workspace context menu

How I tested it

  • CDP against this worktree's signed-in Electron renderer (localhost:4245, CDP 9248), using real menu clicks and before/after screenshots.
  • Reproduced the position jump before the fix. Afterward, a project workspace at y=780 creates its group header at y=780 without scrolling; a session at y=420 likewise creates its group at y=420.
  • Verified single-workspace submenu and bulk menu creation, focused/selected rename input, saving a name, and navigation. The originally reported missing rename focus did not reproduce; rename focus logic is unchanged.
  • Five ordering tests pass, covering source position, bulk selection order, existing groups, and standalone creation.
  • bun run lint, bun run typecheck, bun run check:i18n, and bun run check:plugins pass.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs (not a fork)

Summary by cubic

Creating a sidebar group from a workspace now places the group at the source workspace's position instead of appending it at the end.

Behavior changes

  • Bulk creation uses the earliest selected workspace's position; a workspace already in a group creates a sibling group directly after it.
  • Added "Create new group" to the single-workspace and bulk move menus, including when no groups exist, and moved Pin next to Rename.
  • Translated the new menu label in all shipping locales.

Summary by CodeRabbit

  • New Features

    • Added a Create new group option at the bottom of move-to-group menus.
    • Group creation is now available even when no groups currently exist.
    • Creating a group from selected workspaces preserves intuitive sidebar ordering.
    • Workspace and bulk actions now use the same group-creation flow.
  • Localization

    • Added translations for the new action across supported languages.
  • Tests

    • Added coverage for group placement and ordering scenarios.