Skip to content

feat: analysis assistant stepper handoff and many UX improvements#1212

Draft
dannon wants to merge 10 commits intogalaxyproject:mainfrom
dannon:assistant-tweaks
Draft

feat: analysis assistant stepper handoff and many UX improvements#1212
dannon wants to merge 10 commits intogalaxyproject:mainfrom
dannon:assistant-tweaks

Conversation

@dannon
Copy link
Copy Markdown
Member

@dannon dannon commented Mar 24, 2026

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)

  • Schema context injection -- each user message now includes the current analysis state so the LLM knows what's been decided and doesn't re-ask about filled fields
  • Handoff URL reliability -- fallback catalog lookups for assembly accession (by strain name, preferring reference) and workflow trsId (by name) when the LLM doesn't include them in the expected format
  • Field clearing -- the LLM can now emit null in SCHEMA_UPDATE to clear downstream fields when the user changes their mind (e.g. switching analysis types). System prompt teaches the dependency chain

Session management

  • Session persistence -- session ID stored in localStorage, restored on mount via new GET /session/{id} endpoint. Suggestions now persisted in session state
  • New Conversation button -- clears localStorage and resets all state, with fire-and-forget DELETE /session/{id} cleanup
  • Error recovery -- failed messages stay visible with a Retry button instead of being silently removed

UI polish

  • Content centering -- wrapped assistant layout in SectionContent using the shared sectionLayout mixin (max-width 1136px) to match Learn/About pages
  • BRC logo -- replaced the blue "AI" circle avatar with the BRC Analytics logo
  • Suggestion chips -- styled with light blue border, hover state, and better padding

Stepper handoff

  • When the user clicks "Continue to Workflow Setup", the assistant writes a handoff payload to localStorage with the data source preference (ENA vs upload)
  • The stepper page reads and consumes this on mount, advances past the auto-configured assembly and GTF steps, and pre-selects the sequencing data toggle
  • Stale handoffs (>30 min) are rejected; page refresh gives normal stepper behavior

Test plan

  • Send a message to the assistant, verify the LLM sees current schema state (check backend logs for [Analysis progress: ...] prefix)
  • Complete a full analysis setup, verify handoff URL appears and schema shows complete
  • Change mind mid-conversation ("switch to variant calling"), verify downstream fields clear in the schema panel
  • Refresh the page, verify conversation restores
  • Click "New Conversation", verify clean slate
  • Trigger an API error, verify failed message stays visible with Retry button
  • Complete assistant with "I have my own data" -> click Continue -> stepper should land on sequencing step with Upload toggle selected
  • Complete assistant with ENA data source -> stepper lands on sequencing step with ENA toggle
  • Navigate directly to a stepper page (no assistant) -> normal behavior, starts at first step

@dannon dannon force-pushed the assistant-tweaks branch from 6741e88 to 25cfb75 Compare March 31, 2026 10:53
@dannon dannon changed the title WIP: analysis assistant UX fixes and stepper handoff feat: analysis assistant stepper handoff and many UX improvements Mar 31, 2026
@dannon dannon force-pushed the assistant-tweaks branch from 908ce48 to 19f68f1 Compare April 12, 2026 01:46
@github-actions github-actions bot added the feat label Apr 12, 2026
dannon added 9 commits April 12, 2026 16:15
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.
@dannon dannon force-pushed the assistant-tweaks branch from 19f68f1 to 42d3a7d Compare April 12, 2026 20:15
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant