docs(web): finalize workspace UI product flow

This commit is contained in:
imccyu
2026-07-25 16:15:29 +08:00
parent 9eb9c70a8a
commit 08ce02da2b
14 changed files with 265 additions and 254 deletions

View File

@@ -149,12 +149,18 @@ export class SessionManager {
return session
}
/** @returns the active frontend Session, if one remains selected. */
/**
* Resolve the active frontend Session Intent.
* @returns the active frontend Session, if one remains selected.
*/
getIntent(): Session | undefined {
return this.intentSessionId === undefined ? undefined : this.sessions.get(this.intentSessionId)
}
/** @param text - exact controlled-input value for the active frontend Session. */
/**
* Update the retained prompt of the active frontend Session.
* @param text - exact controlled-input value for the active frontend Session.
*/
updateIntent(text: string): void {
this.getIntent()?.updatePendingPrompt(text)
}

View File

@@ -209,17 +209,24 @@ export class SessionsService {
* Start or retarget the sole client-local Session intent.
* @param target - resolved real or frontend-only Workspace target.
* @param prompt - optional prompt retained across retargeting.
* @returns the frontend Session object that owns the Intent.
*/
startIntent(target: SessionIntentTarget, prompt = ''): Session {
return this.manager.startIntent(target, prompt)
}
/** @returns the active frontend Session object, if one exists. */
/**
* Resolve the active frontend Session Intent.
* @returns the active frontend Session object, if one exists.
*/
intent(): Session | undefined {
return this.manager.getIntent()
}
/** @param text - exact controlled-input value for the current Session Intent. */
/**
* Update the retained prompt of the active frontend Session.
* @param text - exact controlled-input value for the current Session Intent.
*/
updateIntent(text: string): void {
this.manager.updateIntent(text)
}

View File

@@ -141,7 +141,10 @@ export class Session implements ObservableSnapshot<ConversationSnapshot> {
return result
}
/** @param text - exact controlled value of this Session's retained prompt. */
/**
* Update this Session's retained prompt while it remains editable.
* @param text - exact controlled value of this Session's retained prompt.
*/
updatePendingPrompt(text: string): void {
const pending = this.pendingPrompt
if (pending === null || pending.phase === 'sending') return