fix: show binary question group menu on mobile#4351
Conversation
📝 WalkthroughWalkthroughThe ForecastChoiceOption component was modified to wrap the SliderElement in a flex container and conditionally render an accompanying menu item to its right across both desktop and mobile layouts. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
Cleanup: Preview Environment RemovedThe preview environment for this PR has been destroyed.
Cleanup triggered by PR close at 2026-02-26T12:16:31Z |
|
@claude spacing is wrong, the slider overlaps with the ··· button.
|
|
Claude finished @SylvainChevalier's task in 1m 24s —— View job Fixing slider/menu overlap on mobile
SummaryThe slider container was using
|
Use flex-1 with min-w-0 instead of w-full so the slider respects the menu button's space, and add shrink-0 to prevent the menu from being compressed. Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
|
@claude they're still too close to each other. There should be some space between them. |
|
Claude finished @SylvainChevalier's task in 45s —— View job Adding spacing between slider and menu button
SummaryAdded |
Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
|
lgtm. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
front_end/src/components/forecast_maker/forecast_choice_option.tsx (1)
306-311: Consider aligning desktop implementation for consistency.The desktop implementation uses a different pattern (
w-fulland unconditional menu rendering) compared to the mobile fix. While this works fine on larger screens, unifying the approach would improve consistency and maintainability.♻️ Optional: Align desktop with mobile pattern
<td className="hidden w-full border-t border-gray-300 p-2 dark:border-gray-300-dark sm:table-cell"> - <div className="flex"> - <div className="w-full">{SliderElement}</div> - <div>{menu}</div> + <div className="flex items-center gap-2"> + <div className="min-w-0 flex-1">{SliderElement}</div> + {menu && <div className="shrink-0">{menu}</div>} </div> </td>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@front_end/src/components/forecast_maker/forecast_choice_option.tsx` around lines 306 - 311, The desktop table cell renders SliderElement and menu unconditionally and uses a different layout pattern (w-full plus separate menu div) than the mobile fix; update the desktop rendering in forecast_choice_option.tsx to match the mobile pattern by conditionally rendering the menu alongside SliderElement (use the same wrapper/visibility logic used for mobile) and consolidate the sizing classes (replace separate w-full div + menu div with a unified flex container that applies the same width/visibility behavior), targeting the elements named SliderElement and menu so the desktop and mobile implementations are consistent and maintainable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@front_end/src/components/forecast_maker/forecast_choice_option.tsx`:
- Around line 306-311: The desktop table cell renders SliderElement and menu
unconditionally and uses a different layout pattern (w-full plus separate menu
div) than the mobile fix; update the desktop rendering in
forecast_choice_option.tsx to match the mobile pattern by conditionally
rendering the menu alongside SliderElement (use the same wrapper/visibility
logic used for mobile) and consolidate the sizing classes (replace separate
w-full div + menu div with a unified flex container that applies the same
width/visibility behavior), targeting the elements named SliderElement and menu
so the desktop and mobile implementations are consistent and maintainable.

Fix the missing ··· menu on mobile for binary question group subquestions.
The three-dot menu was only rendered in the desktop-only table cell. Now it also appears to the right of the slider in the mobile row.
Closes #4333
Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Style