Skip to content

fix: experiment form UX fixes - #8251

Open
Zaimwa9 wants to merge 4 commits into
mainfrom
fix/experiment-form-low-hanging-fruits
Open

fix: experiment form UX fixes#8251
Zaimwa9 wants to merge 4 commits into
mainfrom
fix/experiment-form-low-hanging-fruits

Conversation

@Zaimwa9

@Zaimwa9 Zaimwa9 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Small experiment UX fixes:

  • Refetch multivariate flags when landing on the experiment setup step, so flags made multivariate in another tab appear without a full refresh.
  • Keep the typed event name when the metric event combobox loses focus. The reactstrap modal wrapper steals focus on any click inside it, which made react-select discard the draft; the value is now committed on blur.
  • Winning variation stat now renders in the default text colour, matching the other result cards.
  • Removed a redundant ms-lg-2 on the PageTitle CTA that indented the button when it wraps below the description (e.g. Segments page).

How did you test this code?

Manually.

image image

@Zaimwa9
Zaimwa9 requested a review from a team as a code owner August 10, 2026 14:37
@Zaimwa9
Zaimwa9 requested review from talissoncosta and removed request for a team August 10, 2026 14:37
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview Aug 10, 2026 2:37pm
flagsmith-frontend-staging Ready Ready Preview Aug 10, 2026 2:37pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Aug 10, 2026 2:37pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The changes control typed input in EventNameSelect, commit non-empty input on blur, and refresh the feature-list query on mount or argument changes. The changes also remove a responsive CTA margin and render the winning variation without the conditional success wrapper.

Estimated code review effort: 2 (Simple) | ~10 minutes


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added front-end Issue related to the React Front End Dashboard fix labels Aug 10, 2026
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-8251 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-8251 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-8251 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-8251 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-8251 Finished ✅ Results

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 99e25f14-b941-426a-95b3-98a8837b72aa

📥 Commits

Reviewing files that changed from the base of the PR and between eeac6b3 and 78ffcff.

📒 Files selected for processing (4)
  • frontend/web/components/PageTitle.tsx
  • frontend/web/components/experiments/EventNameSelect/EventNameSelect.tsx
  • frontend/web/components/experiments/results/ExperimentSummaryScorecard.tsx
  • frontend/web/components/experiments/steps/SetupStep.tsx

Comment on lines +37 to +49
const [inputValue, setInputValue] = useState('')

// Keep the typed text on blur (react-select discards it by default) so
// clicking outside commits the value instead of clearing it.
const handleInputChange = (val: string, meta: InputActionMeta) => {
if (meta.action === 'input-change') setInputValue(val)
if (meta.action === 'set-value') setInputValue('')
}
const handleBlur = () => {
if (!inputValue) return
onChange(inputValue)
setInputValue('')
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Clear the draft when the user clears the selection.

react-select 5.9.0 sends the clear-indicator action through onChange with action: 'clear'. Option selection uses the separate onInputChange set-value path handled here. (raw.githubusercontent.com)

If the user types a draft, clicks the clear control, and then blurs the field, inputValue remains populated. handleBlur can then call onChange(inputValue) and restore the cleared event.

Handle actionMeta.action === 'clear' in the select onChange callback. Add a regression test for draft input followed by clear and blur.

Suggested fix
-        onChange={(option: EventOption | null) => onChange(option?.value ?? '')}
+        onChange={(option: EventOption | null, actionMeta) => {
+          if (actionMeta.action === 'clear') setInputValue('')
+          onChange(option?.value ?? '')
+        }}
Verification script
#!/bin/bash
set -euo pipefail

select_source="$(
  fd -t f 'Select.tsx' . 2>/dev/null |
    while IFS= read -r file; do
      if rg -q "action: 'clear'|action: 'set-value'" "$file"; then
        printf '%s\n' "$file"
        break
      fi
    done
)"

if [[ -z "$select_source" ]]; then
  printf '%s\n' 'Could not locate the react-select source.' >&2
  exit 2
fi

rg -n -C 3 "action: 'clear'|action: 'set-value'" "$select_source"
rg -n -C 6 'handleInputChange|handleBlur|onChange=' \
  frontend/web/components/experiments/EventNameSelect/EventNameSelect.tsx

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19158 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  38.1 seconds
commit  78ffcff
info  🔄 Run: #19158 (attempt 1)

🗂️ Previous results
✅ oss · depot-ubuntu-latest-arm-16 — run #19158 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  40.2 seconds
commit  78ffcff
info  🔄 Run: #19158 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #19158 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.1 seconds
commit  78ffcff
info  🔄 Run: #19158 (attempt 1)

@github-actions

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant