Quick help prompts
The three quick prompt buttons at the bottom of the action-assistant panel (tap to switch to the matching module and send a preset question) should not stay fixed forever. They sho
Source docs/en/site/mech-quick-prompt.md
Goal
The three quick prompt buttons at the bottom of the action-assistant panel (tap to switch to the matching module and send a preset question) should not stay fixed forever. They should change with which module the user is on, whether a workspace is selected, and recent conversation in the assistant, so the next likely entry is shown first.
What users feel: in the same product, the assistant “guesses what you might do next” follows the scene. Implementation is still local, explainable ranking — not a black-box model.
Signals and scoring (explainable)
Implementation lives in client/web/src/workspaceHelpQuickActions.ts, function pickWorkspaceHelpQuickActions(ctx, limit).
Input context WorkspaceHelpQuickContext:
| Field | Meaning |
|---|---|
activeModule | Current main-UI module (same as the left console) |
hasWorkspace | Whether a workspace is selected |
messages | Recent conversation inside the action assistant (last several messages participate in keyword match) |
Each candidate in the pool accumulates a score, then is sorted; take the first limit (default 3), and the same nav appears only once.
Feature families in use now:
- Module complement
Look up MODULE_COMPLEMENT by activeModule and boost other modules that are “more likely next”; slightly down-rank candidates for the current module (the user is already on that screen; prefer neighboring tasks).
- Reachable with no workspace
Same as canWorkspaceHelpNavigate: with no workspace selected, only chat / workspace / im / me are allowed. Candidates are filtered before scoring so chips that cannot navigate do not appear.
- Keyword hits
Concatenate recent messages (lowercase) and match several regex groups for intents such as “workspace / skill / account / assistant / conversation”, then weight the matching nav.
- Conversation depth
When the user has spoken many rounds, slightly raise “continue the conversation” candidates so follow-up questions are easy.
- Business prior
For example: with no workspace, slightly raise candidates related to creating a workspace; with a workspace, slightly raise skill-related candidates (exact numbers are source constants).
On a tie, a fixed TIE_ORDER keeps ranking stable so the UI does not jitter.
Candidate pool and copy
Candidates are maintained in the source array CANDIDATES. Each has id, nav, and label / prompt (may be functions that switch on hasWorkspace and similar, e.g. “create a workspace first” copy when none is selected).
Current nav coverage: workspace, me, skills, agents, workflows, apps, im, chat (module types scheduled / cs participate in complement scoring; the pool itself does not include those two). With no workspace selected, only chat / workspace / im / me are allowed. How many are shown is decided by filter and sort.
Front-end hookup
- Sort and filter:
pickWorkspaceHelpQuickActions() - Consumer:
client/web/src/WorkspaceHelpWidget.tsx
useMemo depends on activeModule, hasWorkspace, messages, and recomputes the three buttons when conversation in the panel changes.
- Pass current module:
client/web/src/App.tsxpassesactiveModuleas props intoWorkspaceHelpWidget.
Extension and replacement (predictive service)
If later you want server ranking or a small model:
- Keep
WorkspaceHelpWidgetdepending only on a contract that “returns at most 3{ nav, label, prompt }”. - Replace
pickWorkspaceHelpQuickActionswith an async source (e.g.fetchQuickActions(ctx)); until load finishes, keep local ranking as a placeholder or skeleton. - Analytics suggestion: record chip
id/navimpressions and clicks for weight tuning or training; can align with existingtrackHelpActionEvent(see the extension notes in 帮助动作链接.md).
Related documents
- 帮助动作链接.md: executable links in help answers and action dispatch
- ../产品规格.md §4.1.5: product-side user-language truth