Skip to content

fix experiment settings update and results UI - #557

Merged
Blaumaus merged 1 commit into
mainfrom
fix/experiments-crud
May 26, 2026
Merged

fix experiment settings update and results UI#557
Blaumaus merged 1 commit into
mainfrom
fix/experiments-crud

Conversation

@Blaumaus

@Blaumaus Blaumaus commented May 26, 2026

Copy link
Copy Markdown
Member

Changes

If applicable, please describe what changes were made in this pull request.

Community Edition support

  • Your feature is implemented for the Swetrix Community Edition
  • This PR only updates the Cloud (Enterprise) Edition code (e.g. Paddle webhooks, blog, payouts, etc.)

Database migrations

  • Clickhouse / MySQL migrations added for this PR
  • No table schemas changed in this PR

Documentation

  • You have updated the documentation according to your PR
  • This PR did not change any publicly documented endpoints

Summary by CodeRabbit

  • New Features

    • Experiments tab now supports filtering and segmentation capabilities
  • Bug Fixes

    • Disabled edit and refresh controls when experiments are completed to prevent unintended modifications
    • Improved experiment results layout consistency and alignment
    • Refined feature flag and goal configuration handling during experiment updates

Review Change Stack

@Blaumaus Blaumaus self-assigned this May 26, 2026
@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4d9d86c2-309b-4438-ae5a-3545f7fe88b1

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 1263d9d and 0ff1445.

πŸ“’ Files selected for processing (3)
  • web/app/pages/Project/View/utils/projectViewSegments.ts
  • web/app/pages/Project/tabs/Experiments/ExperimentResults.tsx
  • web/app/routes/projects.$id.tsx

πŸ“ Walkthrough

Walkthrough

This PR refines the experiments tab by updating server-side feature flag handling logic, enabling filter support for the experiments analytics view, and adding state-driven UI gating for completed experiments with corresponding layout improvements to results display components.

Changes

Experiment Results and Update Handling

Layer / File(s) Summary
Update-Experiment Action β€” Feature Flag Mode Logic
web/app/routes/projects.$id.tsx
The update-experiment action handler now conditionally constructs feature flag fields based on featureFlagMode: for create mode, featureFlagKey is included only if provided; for link mode, featureFlagKey is set to null and existingFeatureFlagId is included only when present. goalId is normalized to null when falsy.
Analytics Tab Configuration for Experiments
web/app/pages/Project/View/utils/projectViewSegments.ts
Adds PROJECT_TABS.experiments to ANALYTICS_TABS and maps it to FILTERS_PANELS_ORDER in FILTER_OPTIONS_BY_TAB, enabling experiments to use filter support and segmentation like other analytics-backed tabs.
Experiment Results UI β€” Completed State Gating
web/app/pages/Project/tabs/Experiments/ExperimentResults.tsx
Derives an isCompleted flag from results.status === 'completed' to gate UI elements: the DashboardHeader refresh button and period selector are disabled/hidden when completed, and the edit tooltip and button are only rendered when not completed (with button disabled while running).
Experiment Results UI β€” Layout and Styling Updates
web/app/pages/Project/tabs/Experiments/ExperimentResults.tsx
Health warnings container layout changes from responsive lg:grid-cols-2 to grid w-full with adjusted spacing. The "stop recommendation" and "winner found" banners are updated to include w-full width and appropriate alignment properties.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Swetrix/swetrix#527: Refines feature flag mode logic in the update-experiment handler for create vs link modes, directly overlapping with the backend updateExperiment refactor for feature-flag linking behavior.
  • Swetrix/swetrix#536: Adds filters support and resolvedTimeBucket-driven segmentation fields to experiments results, which directly matches this PR's enabling of filter support for the experiments analytics tab.

Poem

🐰 Experiments now sit pretty,
With filters in the city,
Completed states stay still and neat,
While layouts make the view complete! ✨

πŸš₯ Pre-merge checks | βœ… 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely incomplete, containing only an empty template with unchecked checkboxes and no actual details about the changes made. Add specific descriptions of the three files changed: projectViewSegments.ts (analytics tabs), ExperimentResults.tsx (UI gating and styling), and projects.$id.tsx (feature flag logic), plus address which checklist items apply.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (3 passed)
Check name Status Explanation
Title check βœ… Passed The title clearly describes the main changes: fixing experiment settings updates and results UI improvements across multiple files.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/experiments-crud

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 and usage tips.

@Blaumaus
Blaumaus merged commit 24d881b into main May 26, 2026
12 checks passed
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.

1 participant