Skip to content

fix(dashboard): show memory prompts and keep scope picker closed - #2698

Merged
hidb4ai merged 5 commits into
oceanbase:masterfrom
Jking798:fix/dashboard-prompts-and-scope
Nov 19, 2026
Merged

hidb4ai merged 5 commits into
oceanbase:masterfrom
Jking798:fix/dashboard-prompts-and-scope

Conversation

@Jking798

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Closes #2696
Closes #2697

Rationale for this change

The Dashboard omits registered Topic Memory and Profile prompts.
The scope selector also reopens unexpectedly after switching scopes.

What changes are included in this PR?

  • Display all seven Topic Memory prompt stages and Profile generation, with English and Chinese labels.
  • Release the outgoing scope picker's focus before HTMX replaces the workspace, preventing the replacement dropdown from reopening.
  • Add regression tests for prompt visibility, custom content, historical revisions, and mouse/keyboard scope navigation.

Are there any user-facing changes?

The Prompts page now displays 15 configurations.
The scope dropdown stays closed after switching scopes, while reopening, searching, and keyboard navigation remain functional.

No public API or database schema changes.

How was this change tested?

8 focused regression tests passed, including real Edge browser tests for scope selection, delayed option loading, search, and Escape dismissal.

Ruff lint, formatting, and git diff --check passed.
The full repository test suite was not run.

AI usage statement

OpenAI Codex assisted with diagnosis, implementation, regression tests, and validation.

@CLAassistant

CLAassistant commented Nov 17, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Zxf-xufeng Zxf-xufeng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Design note (non-blocking): Group prompts by capability

Would you consider grouping the 15 prompt configurations into six capability groups: Memory, Topic Memory, Experience, Skill, Handoff, and Profile?

The flat list exposes internal stages such as planning, reduction, and reconciliation at the same level as user-facing capabilities. This can make the page harder to understand and suggest that every stage runs on every request.

A possible layout:

  • Show capability groups with their prompt counts.
  • Expand a group to show each prompt's name, a short purpose description, and configuration source.
  • Open an individual prompt to view its instructions, demonstrations, revision, and history.
  • Keep technical keys searchable and visible in the details.
  • For Topic Memory, explain that stages run conditionally based on input size and processing results.
  • Distinguish configuration source ("Built-in default" / "Custom") from runtime availability, with the reason shown when unavailable.

This could preserve access to every configuration while making the default view easier to navigate. It is an optional UX improvement and could be handled in a follow-up PR; it does not block the current fixes.

@Zxf-xufeng Zxf-xufeng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One correctness issue remains in the new demonstrations section: an unavailable historical revision falls back to the current examples. Please keep the selected revision’s content hidden when that revision cannot be loaded.

Comment on lines +47 to +48
{% set demonstrations = opened.content.demonstrations if opened else (prompt.effective.demonstrations if prompt.effective else []) %}
{% if demonstrations %}<h2 class="section-title">{{ t.prompt_demonstrations }}</h2><pre class="page-body-pre text-break">{{ demonstrations|tojson(indent=2) }}</pre>{% endif %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Do not fall back to current demonstrations when a historical revision fails to load

I reproduced this by creating memory.rerank revisions 1 and 2 with different demonstrations, then opening /dashboard/prompts?scope=<scope>&prompt_key=memory.rerank&prompt_revision=99. The page reports that the requested revision could not be loaded, but still renders revision 2’s demonstrations below the error. When prompt_opened is absent, this new block falls back to prompt.effective.demonstrations, outside the prompt_selected error guard used for the instructions. This mixes current content into a failed historical view. Please apply the same error guard to the demonstrations and cover this case with non-empty examples.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed independently at a647dce through the HTTP routes backed by SQLite: revision 1 shows only the old demonstration, while revision 99 shows the current revision 2 demonstration despite the load failure. The added historical-revision tests use empty demonstrations, so they do not catch this regression. This finding remains unresolved.

@AlexStocks AlexStocks added the 1.6.0 v1.6.0 release tracking label Nov 18, 2026
Hide current examples and metadata when the requested revision is unavailable. Validate selected and comparison revisions and cover nonempty examples, missing versions, and malformed parameters.

@Zxf-xufeng Zxf-xufeng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed at 5d3b0b8. The historical-demonstration fallback is fixed: the SQLite-backed HTTP reproduction now preserves the selected revision and displays no current examples when revision 99 is unavailable. No remaining blocking findings or new public interfaces/database tables in the PR diff. Relevant prompt/history tests pass; browser interactions were not rerun in this review.

@hidb4ai
hidb4ai merged commit cbce171 into oceanbase:master Nov 19, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.6.0 v1.6.0 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Scope selector reopens after switching scopes bug: Dashboard omits Topic Memory and Profile prompt configurations

5 participants