Expose atomic Session and conversation-view navigation for Web plugins #5192
TommyZeng777
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Web plugins can open a durable Session through
ctx.sessions.open(sessionId), but they cannot atomically select the target Session's conversation view through a supported public API.Discussion #2346 proposed this capability and was later marked as resolved and closed. However, neither
dsh-v0.1.2-alpha.2nor the current GitHub master exposesopenSession(sessionId, viewId),selectView, or an equivalent method onIConversation.I would like to clarify whether a replacement API already exists. If it does not, I propose exposing an atomic Session-and-view navigation operation for Web plugins.
Current limitation
The public API can activate a Session:
However, the active
conversation.viewis still owned by a private, per-Sessionui-conversationstore.A plugin cannot reliably express:
as one supported operation.
Calling
sessions.open(sessionB)may activate Session B while leaving it on its previously selected view, such as a plugin-provided custom view or the Trajectory view.Real-world plugin impact
While developing a real out-of-tree Web plugin with multiple Session-scoped views, I found that returning to a target Session's official Chat view currently requires the plugin to:
[role="tab"]elements;.click();MutationObserverto wait for the target surface to mount;This workaround has caused several real regressions:
These problems can affect any plugin that opens another Session and expects a particular target view.
Proposed public contract
One possible API shape is:
Example:
The exact name and location are only suggestions. The important part is that one owner coordinates Session activation and view selection as a single transaction.
Expected behavior
The operation should:
viewIdif the target Session has not mounted yet;AbortSignal;The per-Session view store can remain private. Plugins only need the orchestration capability, not direct access to its implementation.
Relationship to existing discussions
visibleandfocusedstate.This proposal is narrower than full multi-Session presentation. It addresses the atomic navigation operation required even when the interface continues to display only one Session at a time.
If #4718 becomes the preferred architecture, the same capability could be represented inside that protocol. For example:
Questions for maintainers
conversation.view?ctx.conversation,ctx.sessions, or a broader presentation/navigation service?I can provide a minimal reproduction and sanitized acceptance cases if they would help define the contract.
All reactions