Skip to content

feat: reorder services across the top-level session list - #1246

Merged
edwin-zvs merged 3 commits into
mainfrom
service-toplevel-reorder
Aug 11, 2026
Merged

feat: reorder services across the top-level session list#1246
edwin-zvs merged 3 commits into
mainfrom
service-toplevel-reorder

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

What

Two session-list fixes/features around service rows:

  1. Service rows now reorder across the whole top level. Previously the reorder action (Shift+↑/↓, C-x C-p/C-n, web drag) only swapped a service with its sibling services — it silently stopped at the service-block boundary. A service row can now step past ungrouped sessions and hop whole project blocks in both directions, while staying a top-level row (services never nest inside a project). Services that are never moved keep the legacy leading-block layout, and new services still append there.

  2. Clicking a service row keeps the list focused. A mouse click on a service row used to hand pane focus to the service view, so the row's selection highlight rendered in the unfocused style even though the user was interacting with the list. It now matches session-row clicks: the sidebar keeps focus (and the focused highlight); the prepared service editor is still one Tab away.

How

  • The persisted form of an interleaved slot is a pin, not an anchor: the service records which region it sits in (sessions or projects) plus the position value of the row it was dropped after. At equal values the session/project row sorts first, then services in their own order. Pinning to a value keeps the service in place when the neighbor it was dropped after is archived, deleted, or moved — no stale-id fallbacks.
  • service.move in the daemon now computes each step against the same top-level flow the clients render (it fetches sessions + projects for this), then re-derives every service's persisted order from the result: contiguous service positions in flow order, placements re-pinned to the current preceding row. This self-heals pins whose row values have vanished.
  • TUI list_items and web UI orderedItems splice placed services into the ungrouped-session run and between project blocks with the same ordering rule; routed sessions still nest under their service row wherever it renders. Web drag now counts steps over the same flow rows the daemon walks.
  • Spec: adds 0198-services-reorder-across-the-top-level, supersedes 0195's no-interleave rule.

Tests

  • Daemon: full walk down/up across sessions and project blocks with edge no-ops; pinned-slot stability when the pinned neighbor vanishes; routed service sessions excluded from the step flow.
  • TUI: interleaved list_items ordering; service-row click now asserts list focus stays.
  • Full cargo test --workspace green.

🤖 Generated with Claude Code

…service click

- service.move now steps a service row through the whole top-level flow:
  past ungrouped sessions and over whole project blocks, both directions,
  with the leading service block preserved for never-moved services
  (supersedes spec 0195's no-interleave rule; adds spec 0198)
- placement persists as (region, pinned position value) on the service
  definition, re-derived and self-healed on every step
- TUI and web UI render the interleave with the daemon's ordering rule;
  web drag steps count the same flow rows the daemon walks
- clicking a service row keeps keyboard focus (and the focused selection
  highlight) on the session list, matching session-row clicks
@edwin-zvs

Copy link
Copy Markdown
Contributor Author

Demo (after): a service row (bravo) walking down past two ungrouped sessions, hopping the backend project block, then stepping back up — driven with C-x C-n / C-x C-p from the session list. Note the focused (bright) selection highlight on the service row while the list owns focus.

service reorder across top level

@edwin-zvs
edwin-zvs merged commit 871d08b into main Aug 11, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the service-toplevel-reorder branch August 11, 2026 14:18
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