Skip to content

feat(desktop): add home session actions - #43245

Merged
Hona merged 5 commits into
v2from
home-session-actions
Aug 24, 2026
Merged

Hona merged 5 commits into
v2from
home-session-actions

Conversation

@usrnk1

@usrnk1 usrnk1 commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

N/A

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a context menu to Home session rows with rename, JSON export, and confirmed deletion. The menu opens at the right-click position, supports keyboard invocation and touch long-press, and reuses the existing session APIs and export format. Rename and delete update the Home caches so stale titles and deleted rows do not return when navigating back.

How did you verify your code works?

  • bun turbo typecheck --concurrency=3
  • bun run test:unit in packages/app (552 tests)
  • bun typecheck:e2e in packages/app
  • bunx playwright test e2e/regression/home-session-actions.spec.ts
  • Production benchmark build succeeds; the existing Home benchmark scenarios fail before measurement because their mocked sessions do not render, matching the baseline run.

Screenshots / recordings

Screenshot.2026-08-18.at.16.11.45.mp4

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@usrnk1
usrnk1 marked this pull request as ready for review August 18, 2026 14:15
@anomalyco anomalyco deleted a comment from Enough1122 Aug 21, 2026
@Enough1122

Copy link
Copy Markdown

AI code review — automated review for reference; please use your judgment.

  • packages/app/src/pages/home/home-sessions-controller.tsx:228-231 — DeleteDialog's confirm has no in-flight guard, so a double-click on "Delete session" fires two DELETE requests; the second rejects once the session is gone and pops an error toast after the dialog already closed. Track a pending state and disable the danger button until remove() settles.
  • packages/app/src/pages/home/home-sessions-view.tsx:513 — the rename input's onKeyDown calls event.stopPropagation() for every key, not just Enter/Escape, which blocks all global keybinds (command palette, search, tab switching) while the editor is open. Stop propagation only for the keys you actually handle.
  • packages/app/src/pages/home/home-sessions-controller.tsx:51 and :82 — removed.keys grows without bound and is scanned with Array.includes() inside the indexedSessions memo, making every recompute O(sessions × removed) on a long-lived home page. Use a Set (or a record keyed by `${server}\0${id}`) instead of an array scan.
  • packages/app/src/pages/home/home-sessions-controller.tsx:151 — rename() returns true for a blank title, so committing an empty field exits through the "saved" path and callers can't distinguish saved from cancelled. Return false (or a tri-state) for the blank case so saveEditor's saved flag keeps its meaning.
  • packages/app/src/pages/home/home-sessions-view.tsx:445-451 — finishLongPress resets suppressClick in an untracked setTimeout, relying on task ordering between that timer and the browser-synthesized click; a delayed click or a second long-press in the same tick can clear the flag at the wrong moment and let the tap fall through to onOpenSession. Track the reset timer like longPressTimer, or consume the flag synchronously in onClick.
  • packages/app/src/pages/home/home-sessions-view.tsx:501-524 (nit) — the rename InlineInput has no accessible label, so screen readers announce an unlabeled edit field; an aria-label from the existing rename strings would fix it.

@Hona
Hona force-pushed the home-session-actions branch from cb7415d to fcb1e27 Compare August 24, 2026 01:01
@Hona
Hona merged commit 3f807d8 into v2 Aug 24, 2026
7 checks passed
@Hona
Hona deleted the home-session-actions branch August 24, 2026 03:18
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants