Skip to content

FIX GUI promote conversation to main feature working#1513

Merged
adrian-gavrila merged 1 commit intomicrosoft:mainfrom
adrian-gavrila:fix/promote-main-conversation
Mar 18, 2026
Merged

FIX GUI promote conversation to main feature working#1513
adrian-gavrila merged 1 commit intomicrosoft:mainfrom
adrian-gavrila:fix/promote-main-conversation

Conversation

@adrian-gavrila
Copy link
Copy Markdown
Contributor

Description

The star button in the Conversation Panel (used to promote a conversation to "main") was non-functional due to three compounding issues:

  1. URL mismatch — The frontend called /attacks/{id}/change-main-conversation but the backend route is
    /attacks/{id}/update-main-conversation. The API call silently 404'd and the error was swallowed by the catch block.
  2. No UI refresh — After a successful promote, the conversation panel did not refresh, so the star icons stayed stale until
    navigating away and back.
  3. No explanation for disabled state — When the star was disabled (target mismatch or operator locking), the tooltip still said "Promote to main conversation." with no indication of why the promotion was being blocked. There is now a message stating which promotion condition is blocking (no target set, mismatched conversation, different operator)

Changes

  • frontend/src/services/api.ts — Fix endpoint URL from change-main-conversation to update-main-conversation
  • frontend/src/components/Chat/ChatWindow.tsx — Add setPanelRefreshKey after successful promote; replace boolean locked
    prop with lockedReason string carrying contextual messages
  • frontend/src/components/Chat/ConversationPanel.tsx — Update prop interface and tooltips to display specific lock reasons
  • frontend/e2e/flows.spec.ts — Update two seeded E2E tests to click the star button via UI instead of calling the backend API
    directly (removing workaround for the URL mismatch)

Tests and Documentation

  • All 407 frontend unit tests pass (npx jest)
  • Updated E2E tests in flows.spec.ts: "should change main conversation" and "full lifecycle" now test the full UI click → API →
    refresh flow instead of bypassing the frontend with direct API calls
  • Manually verified: star click returns 200 in DevTools, star icons update immediately, contextual tooltips display correct lock
    reason for each disabled state
  • JupyText: N/A — no notebook or documentation changes

- Fix URL mismatch: frontend called /change-main-conversation but
  backend expects /update-main-conversation
- Add panel refresh after successful promote so star icons update
  immediately
- Replace boolean locked prop with lockedReason string for contextual
  disabled tooltips explaining why actions are unavailable
- Update E2E tests to click the star button instead of calling the
  backend API directly, ensuring the full UI flow is tested

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@romanlutz romanlutz left a comment

Choose a reason for hiding this comment

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

Excellent! Good find!

@adrian-gavrila adrian-gavrila merged commit 927ad88 into microsoft:main Mar 18, 2026
41 checks passed
riyosha pushed a commit to riyosha/PyRIT that referenced this pull request Mar 24, 2026
Co-authored-by: Adrian Gavrila <agavrila@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jbolor21 pushed a commit to jbolor21/jbolor-PyRIT that referenced this pull request Mar 25, 2026
Co-authored-by: Adrian Gavrila <agavrila@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants