Proposal: public cross-session conversation view navigation for Web plugins #2346
Closed
Nirvana-Jie
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
A
conversation.viewplugin can select another durable session throughctx.sessions.open(sessionId), but it cannot also select the target conversation view through a supported public API. The active view belongs to a private, per-sessionui-conversationstore.This becomes visible in a session-lineage plugin: selecting a historical branch and clicking Open session changes the durable session, but the target can remain on the Session Tree tab instead of returning to Chat.
Reproduction
conversation.viewentry, for examplesession-tree.ctx.sessions.open(sessionB).session-tree, the user remains in the plugin rather than arriving in Chat.An earlier workaround attempted to call
conversation.showChat()on the target scope. That method is not part ofIConversation, so the runtime correctly fails withconversation.showChat is not a function. DOM clicks,localStorage, or reaching into the private store would make the plugin depend on implementation details and should not be required.Proposed API
Add one explicit navigation method to the outward conversation service:
The plugin call then becomes:
The operation should be owned by
ui-conversationbecause it is the only package that owns both the public Sessions navigation dependency and the private per-session view writers.Prepared implementation
I prepared and locally validated a minimal implementation with these semantics:
actions.setViewwriters.sessions.open.{ sessionId, viewId }request and consume it when that Session mounts.sessions.openthrows.The consumer-side change is available in
dsh-session-tree, specificallyfix(client): use supported session navigation.Validation
The prepared Harness change passes 40 focused
ui-conversationtests covering service orchestration, slot injection, active targets, targets that mount after navigation, failure cleanup, and generation-safe teardown.The plugin passes 22 Vitest tests plus coverage, TypeScript, lint, build, and publint checks.
A real DSH Web verification exercised this path:
aria-selected="true".The clean browser run completed with no console errors or warnings.
Question for maintainers
Does
IConversation.openSession(sessionId, viewId)fit the intended plugin API, or would maintainers prefer a more general navigation capability? I can publish the prepared Harness commit from a fork once the API direction is confirmed.中文摘要
目前 Web 插件可以通过
sessions.open切换持久化会话,但无法通过公开 API 同时指定目标会话的活动视图;视图状态属于ui-conversation的私有会话级 store。因此会话树插件点击“打开会话”后,可能已经切换到目标会话,却仍停留在“会话树”而不是“对话”。建议由ui-conversation提供conversation.openSession(sessionId, viewId),原子地完成会话与视图切换,并处理目标会话尚未挂载、打开失败和组件卸载竞争。实现与真实端到端验证已经完成,确认方向后可以从 fork 提交 PR。All reactions