Repository navigation
fix(dashboard): show memory prompts and keep scope picker closed - #2698
Conversation
Zxf-xufeng
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
| {% 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 %} |
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
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.
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.
hidb4ai
left a comment
There was a problem hiding this comment.
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.
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?
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.