Skip to content

Mobile: introduce forecaster tab bar + styling-parity pass#4682

Open
ncarazon wants to merge 15 commits intofeat/question-page-redesign-1st-iterationfrom
feat/mobile-introduce-forecaster-tab-bar-styling-parity-pass
Open

Mobile: introduce forecaster tab bar + styling-parity pass#4682
ncarazon wants to merge 15 commits intofeat/question-page-redesign-1st-iterationfrom
feat/mobile-introduce-forecaster-tab-bar-styling-parity-pass

Conversation

@ncarazon
Copy link
Copy Markdown
Contributor

@ncarazon ncarazon commented Apr 30, 2026

Related to #4638

This PR introduces a full mobile styling and layout parity pass for both the consumer and forecaster question page views.

Implemented features & fixes:

  • Consumer mobile typography: question title centered/bold/gray-700 on mobile, scales to blue-800 at md+; comment count badge gets font-bold on mobile
  • Forecaster mobile typography: question title adjusted size/weight/tracking/color on mobile, scales up at sm+; vote count badge adjusted size on mobile only
  • Forecast Timeline label restored across all views and screen sizes (removed hideTitle from ForecasterShell, ConsumerShell, and TimelineTab)
  • Timeline tab added to consumer tab bar on mobile only (< sm); inline timeline chart remains visible at sm+ next to the prediction block
  • Similar Questions tab added to both consumer and forecaster tab bars on mobile only (< sm, approved posts only); data fetched once on mount in QuestionPageShellTabs to avoid re-fetching on tab switch; sidebar author/dates section and Similar Questions removed from mobile layout
  • project_chip_helpers extracted (getChipContent, getChipColor) so both MetaRow and QuestionInfoTab use TrophyIcon consistently instead of an emoji string
  • Tab bar mobile sizing: adjusted pill size and padding with horizontal scroll enabled
  • Section gaps adjusted between main and comments sections on mobile
  • Prediction block: top padding removed on mobile for both binary and continuous question types
  • Continuous graph clipping fix: removed mobile scale to prevent overflow clipping against overflow-x-clip on the parent section; desktop scale preserved
  • Consumer title right padding removed on mobile
  • Key factors section ordering fixed on mobile; top margin disabled on mobile
  • Action row ordering on mobile: prediction shown above buttons below sm, full action row in document order at sm+
  • Comment feed: adjusted header margin and list gap on mobile

Demo videos

  • Consumer view charts
1.mp4
  • Consumer responsive view
2.mp4
  • Forecaster view charts
3.mp4
  • Forecaster responsive view
4.mp4
  • Consumer and forecaster timeline, my scores and similar questions tabs
5.mp4

Summary by CodeRabbit

  • New Features

    • Added "Similar Questions" and "Timeline" tabs to question pages for better content organization.
  • Bug Fixes

    • Fixed chart axis labels from being hidden at chart edges; labels now reposition intelligently.
  • Style

    • Refined responsive spacing and layouts across question pages and comments.
    • Updated section toggle chevron rotation to more clearly indicate open/closed states.
    • Improved comment formatting and styling consistency.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 88dff80c-e6d8-484a-88d2-3a80b5ac7946

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main focus: introducing a forecaster tab bar on mobile and implementing styling parity across consumer and forecaster views.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mobile-introduce-forecaster-tab-bar-styling-parity-pass

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

🚀 Preview Environment

Your preview environment is ready!

Resource Details
🌐 Preview URL https://metaculus-pr-4682-feat-mobile-introduce-forecast-preview.mtcl.cc
📦 Docker Image ghcr.io/metaculus/metaculus:feat-mobile-introduce-forecaster-tab-bar-styling-parity-pass-c168f74
🗄️ PostgreSQL NeonDB branch preview/pr-4682-feat-mobile-introduce-forecast
Redis Fly Redis mtc-redis-pr-4682-feat-mobile-introduce-forecast

Details

  • Commit: d483568b0746734f1b6252a356870be6b3481cae
  • Branch: feat/mobile-introduce-forecaster-tab-bar-styling-parity-pass
  • Fly App: metaculus-pr-4682-feat-mobile-introduce-forecast

ℹ️ Preview Environment Info

Isolation:

  • PostgreSQL and Redis are fully isolated from production
  • Each PR gets its own database branch and Redis instance
  • Changes pushed to this PR will trigger a new deployment

Limitations:

  • Background workers and cron jobs are not deployed in preview environments
  • If you need to test background jobs, use Heroku staging environments

Cleanup:

  • This preview will be automatically destroyed when the PR is closed

@ncarazon ncarazon force-pushed the feat/integrate-the-shell-widen-the-main-column-strip-old-layouts branch from 6285beb to 31e3be1 Compare May 1, 2026 10:29
Base automatically changed from feat/integrate-the-shell-widen-the-main-column-strip-old-layouts to feat/question-page-redesign-1st-iteration May 1, 2026 10:41
ncarazon added 6 commits May 1, 2026 18:22
…estion types, fix comments tab blank below lg
…izontal scroll, and timeline in tab on mobile
…r author section on mobile, shared chip helpers with TrophyIcon, fix continuous graph clipping, and consumer title right padding
…and show compact bar chart for date groups instead of scatter
@ncarazon ncarazon force-pushed the feat/mobile-introduce-forecaster-tab-bar-styling-parity-pass branch from 6240839 to e4a8c28 Compare May 1, 2026 15:22
@ncarazon ncarazon marked this pull request as ready for review May 4, 2026 14:46
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
front_end/src/app/(main)/questions/[id]/components/question_page_shell/tabs/comments.tsx (1)

5-5: Delete responsive_comment_feed.tsx — it is now unused dead code.

The swap from ResponsiveCommentFeed to CommentFeed is correct and complete. The responsive_comment_feed.tsx file (located at front_end/src/app/(main)/questions/[id]/components/question_layout/consumer_question_layout/responsive_comment_feed.tsx) has no remaining imports or references in the codebase and can be safely removed to avoid confusion.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@front_end/src/app/`(main)/questions/[id]/components/question_page_shell/tabs/comments.tsx
at line 5, Remove the now-unused responsive_comment_feed.tsx file: delete the
file named responsive_comment_feed.tsx (previously exporting
ResponsiveCommentFeed) since imports have been switched to CommentFeed (see
import CommentFeed in comments.tsx) and there are no remaining references;
ensure no other modules import ResponsiveCommentFeed before deleting and run the
project/tests to confirm no breakage.
front_end/src/app/(main)/questions/[id]/components/question_page_shell/tabs.tsx (1)

59-64: 💤 Low value

Consider gating the fetch behind a viewport check to avoid unused desktop API calls.

hasSimilarQuestionsTab in tab_bar.tsx already gates the tab behind !isSm (mobile only), but the fetch here fires unconditionally for every APPROVED post on any screen size. Desktop users trigger the API call and result is never displayed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@front_end/src/app/`(main)/questions/[id]/components/question_page_shell/tabs.tsx
around lines 59 - 64, The effect that fetches similar questions should be gated
by the same viewport/mobile check used for rendering the tab to avoid
unnecessary desktop API calls: import or access the same isSm (or the
hasSimilarQuestionsTab logic) used in tab_bar.tsx, add isSm to the useEffect
dependency array, and change the guard to only call
ClientPostsApi.getSimilarPosts(post.id).then(setSimilarQuestions) when
post.curation_status === PostStatus.APPROVED && !isSm (i.e., mobile only);
ensure you reference the existing symbols useEffect, setSimilarQuestions,
similarQuestions, and ClientPostsApi.getSimilarPosts when making this change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@front_end/src/app/`(main)/questions/[id]/components/question_page_shell/tabs.tsx:
- Around line 60-64: The useEffect calling
ClientPostsApi.getSimilarPosts(post.id) must handle errors and avoid race
conditions: add a local cancellation flag (e.g., let cancelled = false) and
return a cleanup that sets it true; call ClientPostsApi.getSimilarPosts inside
the effect, attach .catch to log or handle errors, and only call
setSimilarQuestions with the result if !cancelled and post.curation_status ===
PostStatus.APPROVED (or keep the existing guard) to prevent stale responses
overwriting current state; ensure you reference the existing useEffect,
ClientPostsApi.getSimilarPosts, setSimilarQuestions, post.id and
post.curation_status symbols when making the change.

---

Nitpick comments:
In
`@front_end/src/app/`(main)/questions/[id]/components/question_page_shell/tabs.tsx:
- Around line 59-64: The effect that fetches similar questions should be gated
by the same viewport/mobile check used for rendering the tab to avoid
unnecessary desktop API calls: import or access the same isSm (or the
hasSimilarQuestionsTab logic) used in tab_bar.tsx, add isSm to the useEffect
dependency array, and change the guard to only call
ClientPostsApi.getSimilarPosts(post.id).then(setSimilarQuestions) when
post.curation_status === PostStatus.APPROVED && !isSm (i.e., mobile only);
ensure you reference the existing symbols useEffect, setSimilarQuestions,
similarQuestions, and ClientPostsApi.getSimilarPosts when making this change.

In
`@front_end/src/app/`(main)/questions/[id]/components/question_page_shell/tabs/comments.tsx:
- Line 5: Remove the now-unused responsive_comment_feed.tsx file: delete the
file named responsive_comment_feed.tsx (previously exporting
ResponsiveCommentFeed) since imports have been switched to CommentFeed (see
import CommentFeed in comments.tsx) and there are no remaining references;
ensure no other modules import ResponsiveCommentFeed before deleting and run the
project/tests to confirm no breakage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3f44e806-2135-477f-9b2c-b6149fa8b075

📥 Commits

Reviewing files that changed from the base of the PR and between 282a591 and 5134d3f.

📒 Files selected for processing (24)
  • front_end/src/app/(main)/questions/[id]/components/key_factors/key_factors_question_consumer_section.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_page_shell/index.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_page_shell/meta_row.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_page_shell/project_chip_helpers.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_page_shell/tab_bar.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_page_shell/tabs.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_page_shell/tabs/comments.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_page_shell/tabs/question_info.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_page_shell/tabs/similar_questions.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_page_shell/tabs/timeline.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_page_shell/title_row.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_view/action_row.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_view/consumer_question_view/prediction/group_of_questions_prediction/index.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_view/consumer_question_view/prediction/single_question_prediction/binary_question_prediction.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_view/consumer_question_view/prediction/single_question_prediction/continuous_question_prediction.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_view/consumer_question_view/timeline/index.tsx
  • front_end/src/app/(main)/questions/[id]/components/sidebar/index.tsx
  • front_end/src/components/charts/group_chart.tsx
  • front_end/src/components/charts/primitives/x_tick_label.tsx
  • front_end/src/components/comment_feed/comment.tsx
  • front_end/src/components/comment_feed/index.tsx
  • front_end/src/components/post_card/basic_post_card/post_voter.tsx
  • front_end/src/components/ui/section_toggle.tsx
  • posts/views.py

Comment thread front_end/src/app/(main)/questions/[id]/components/question_page_shell/tabs.tsx Outdated
@ncarazon ncarazon closed this May 5, 2026
@ncarazon ncarazon deleted the feat/mobile-introduce-forecaster-tab-bar-styling-parity-pass branch May 5, 2026 17:18
@ncarazon ncarazon restored the feat/mobile-introduce-forecaster-tab-bar-styling-parity-pass branch May 5, 2026 17:20
@ncarazon ncarazon reopened this May 5, 2026
enabled: post.curation_status === PostStatus.APPROVED,
});

if (isFetching || !questions.length) return null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

its better to add some loading and empty state

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a loading state and fallback to top questions (discussed with Atakan)

@ncarazon ncarazon requested a review from cemreinanc May 6, 2026 11:54
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