Skip to content

feat(web): copy session reference from context menu #950

Description

@heavygee

Problem

When running multiple HAPI sessions (orchestrator + feature peers, parallel investigations), operators need to cite one session inside another — paste a pointer into a different session's composer so the agent or human knows where to look.

Today there is no one-click way to grab that citation from the session list context menu (rename / archive / delete / reopen).

Why not "Copy link"?

A menu item labeled Copy link reads like share access (public URL, guest access, tailnet bookmark). That is not the intent.

The actual use case is same-hub cross-session reference: "see the work already happening in session X" when spawning or continuing a peer. The clipboard text should read as a citation, not an invitation.

Proposal

Add Copy reference to the session More actions menu:

  • Session list: long-press / right-click on a row
  • Session header: overflow (three-dot) menu

Clipboard payload (example):

See session "upstream issue/pr discovery" (/sessions/abc-def) for context

Design choices:

  • Title — human/agent-readable label from session metadata
  • Relative path — navigable within the same PWA/hub; deliberately not a full https:// URL (avoids share-link semantics)
  • "for context" — frames the paste as a citation for another chat

Implementation sketch:

  • web/src/lib/sessionReference.tsbuildSessionReferenceText(title, id)
  • SessionActionMenu — new item after Rename; uses existing safeCopyToClipboard
  • i18n key: session.action.copyReference

Scope

Web-only. No hub/API/SCHEMA_VERSION changes.

Test plan

  • Unit tests for reference string builder
  • Unit test: menu click copies citation and closes menu
  • Manual: right-click session in list → Copy reference → paste into another session composer

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions