Skip to content

remove Y axis for discrete questions in feed and in collapsed group view#4938

Merged
ncarazon merged 1 commit into
mainfrom
feat/remove-discrete-question-y-axis
Jun 30, 2026
Merged

remove Y axis for discrete questions in feed and in collapsed group view#4938
ncarazon merged 1 commit into
mainfrom
feat/remove-discrete-question-y-axis

Conversation

@ncarazon

@ncarazon ncarazon commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Resolves #4900

Removes the Y-axis from discrete question distribution charts in feed cards and collapsed group rows.

Implemented changes:

  • Added support for hiding the chart Y-axis while preserving the distribution, median/range markers, and X-axis.
  • Applied the hidden Y-axis behavior to discrete questions in feed cards and collapsed group forecast rows.
image image

Summary by CodeRabbit

  • New Features
    • Added an option to hide the chart’s Y-axis on certain views.
    • Discrete questions now automatically display charts with a cleaner layout by hiding the Y-axis where appropriate.
  • Bug Fixes
    • Updated chart spacing so labels no longer reserve unnecessary room when the Y-axis is hidden.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7052366e-6e67-4f01-a009-683d42b7d3fe

📥 Commits

Reviewing files that changed from the base of the PR and between 5d97679 and ae7238b.

📒 Files selected for processing (3)
  • front_end/src/components/charts/continuous_area_chart.tsx
  • front_end/src/components/forecast_maker/continuous_group_accordion/group_forecast_accordion_item.tsx
  • front_end/src/components/post_card/question_tile/question_continuous_tile.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • front_end/src/components/post_card/question_tile/question_continuous_tile.tsx
  • front_end/src/components/forecast_maker/continuous_group_accordion/group_forecast_accordion_item.tsx
  • front_end/src/components/charts/continuous_area_chart.tsx

📝 Walkthrough

Walkthrough

ContinuousAreaChart gains a hideYAxis prop that derives a showYAxis flag controlling both horizontal padding and right-side Y-axis rendering. The group accordion item and question tile (three render paths) pass hideYAxis={question.type === QuestionType.Discrete} to suppress the Y axis for discrete questions.

Changes

Discrete Y-axis hiding

Layer / File(s) Summary
ContinuousAreaChart hideYAxis prop and showYAxis logic
front_end/src/components/charts/continuous_area_chart.tsx
Adds optional hideYAxis?: boolean prop (default false), derives internal showYAxis boolean (true when graphType === "cdf" or discrete without hideYAxis), gates horizontalPadding memo and VictoryAxis rendering on showYAxis.
Discrete question call sites
front_end/src/components/forecast_maker/continuous_group_accordion/group_forecast_accordion_item.tsx, front_end/src/components/post_card/question_tile/question_continuous_tile.tsx
Group accordion imports QuestionType and passes hideYAxis to ContinuousAreaChart; question tile adds the same prop across mobile overlay, large-screen overlay, and regular layout render paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • elisescu
  • hlbmtc
  • cemreinanc

Poem

🐇 Hop hop, the axis fades away,
Discrete charts now breathe and play,
No more wiggly lines of mystery,
Just distributions — pure and free!
The rabbit hid what cluttered the view ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: hiding the Y axis for discrete questions in feed and collapsed group views.
Linked Issues check ✅ Passed The code adds a hideYAxis option and applies it to discrete feed and collapsed-group charts as requested.
Out of Scope Changes check ✅ Passed The changes stay focused on discrete-question chart rendering and do not introduce unrelated behavior.
✨ 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 feat/remove-discrete-question-y-axis

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 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Cleanup: Preview Environment Removed

The preview environment for this PR has been destroyed.

Resource Status
🌐 Preview App Deleted
🗄️ PostgreSQL Branch Deleted
⚡ Redis Database Deleted
🔧 GitHub Deployments Removed
📦 Docker Image Retained (auto-cleanup via GHCR policies)

Cleanup triggered by PR close at 2026-06-30T14:31:55Z

@ncarazon ncarazon marked this pull request as ready for review June 25, 2026 08:32
@ncarazon ncarazon requested review from cemreinanc, hlbmtc and lsabor June 25, 2026 08:38
@ncarazon ncarazon force-pushed the feat/remove-discrete-question-y-axis branch from 5d97679 to ae7238b Compare June 30, 2026 14:17
@ncarazon ncarazon merged commit fd67514 into main Jun 30, 2026
15 checks passed
@ncarazon ncarazon deleted the feat/remove-discrete-question-y-axis branch June 30, 2026 14:31
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.

remove Y axis for discrete questions in feed and in collapsed group view

2 participants