feat: analysis assistant stepper handoff and many UX improvements#1212
Draft
dannon wants to merge 10 commits intogalaxyproject:mainfrom
Draft
feat: analysis assistant stepper handoff and many UX improvements#1212dannon wants to merge 10 commits intogalaxyproject:mainfrom
dannon wants to merge 10 commits intogalaxyproject:mainfrom
Conversation
6741e88 to
25cfb75
Compare
908ce48 to
19f68f1
Compare
The LLM was operating blind -- it emitted SCHEMA_UPDATE blocks but never saw what was already filled on subsequent turns, causing it to re-ask about decided fields and generate poor suggestions. Now each user message is prefixed with a compact summary of the current schema state so the agent knows what's been decided and what's still pending.
…traction When the LLM formatted assembly or workflow values without the expected accession or iwcId pattern, the detail field stayed None and the handoff URL couldn't be built -- even though the schema showed complete. Now falls back to searching the catalog by strain/species name for assemblies and by workflow name for workflows.
When a user changes their mind mid-conversation (e.g. switches from RNA-seq to variant calling), the agent can now emit null values in SCHEMA_UPDATE to reset dependent downstream fields back to EMPTY. The system prompt teaches the LLM about the dependency chain so it knows which fields to clear when a higher-level choice changes.
Sessions were lost on page refresh because the session ID lived only in
a React ref. Now the session ID is persisted to localStorage after each
successful message, and restored on mount via a new GET /session/{id}
endpoint. Also adds a DELETE /session/{id} endpoint for cleanup, persists
suggestion chips in the session state, and extracts a shared
compute_handoff() helper used by both chat and restore paths.
The ChatPanel now shows a restoring state and supports an onRetry prop
for error recovery (failed user messages stay visible with a retry
button instead of being silently removed).
Appears above the two-panel layout once a conversation has started. Clears localStorage, resets all hook state, and fires a delete request to clean up the Redis session (fire-and-forget, doesn't block the UI).
The assistant page wasn't centered like other pages (Learn, About). Wrapped the content in a SectionContent container using the shared sectionLayout mixin (max-width 1136px, margin 0 auto). Replaced the blue "AI" circle avatar with the BRC Analytics logo. Styled suggestion chips with a light blue border, hover state, and more padding.
…andling Assembly fallback no longer guesses from species name alone (too ambiguous with multi-assembly organisms). Now only matches on strain name and prefers reference assemblies when multiple match. Added error logging to restore/delete endpoints, alt text on the BRC logo avatar, a double-click guard on the retry callback, and renamed the styled SuggestionChip to StyledSuggestionChip to avoid the type name collision.
When the user completes the analysis assistant and clicks Continue to Workflow Setup, the assistant now writes a handoff payload to localStorage with the data source preference (ENA vs upload) and a timestamp. The stepper page reads and consumes this on mount via useAssistantHandoff, then advances past the auto-configured assembly and GTF steps to land directly on the sequencing data step. If the user chose "upload my own data" in the assistant, the sequencing toggle is pre-selected to the upload view. Stale handoffs (>30 min) are rejected, and page refresh gives normal stepper behavior since the payload is consumed once.
19f68f1 to
42d3a7d
Compare
Use the VIEW enum instead of raw strings for initialDataSourceView prop threading. Add an in-flight guard on sendMessage to prevent double-sends. Replace the eslint-disable empty-deps useEffect in SequencingStep with a ref-based init guard. Simplify onRetry to a single optional type instead of optional-or-null. Combine duplicate workflow name matching conditions in the fallback search.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A batch of UX and agent behavior improvements to the analysis assistant, plus the integration point connecting a completed assistant session to the workflow configuration stepper.
Agent behavior (backend)
nullin SCHEMA_UPDATE to clear downstream fields when the user changes their mind (e.g. switching analysis types). System prompt teaches the dependency chainSession management
GET /session/{id}endpoint. Suggestions now persisted in session stateDELETE /session/{id}cleanupUI polish
SectionContentusing the sharedsectionLayoutmixin (max-width 1136px) to match Learn/About pagesStepper handoff
Test plan
[Analysis progress: ...]prefix)