Skip to content

Labor Hub page#4109

Merged
cemreinanc merged 96 commits intomainfrom
feat/labor-hub-page
Apr 16, 2026
Merged

Labor Hub page#4109
cemreinanc merged 96 commits intomainfrom
feat/labor-hub-page

Conversation

@cemreinanc
Copy link
Copy Markdown
Contributor

@cemreinanc cemreinanc commented Jan 20, 2026

Summary by CodeRabbit

  • New Features

    • Launched Labor Automation Forecasting Hub with interactive charts, jobs monitor, research data, and methodology sections.
    • Added activity timeline markers and hover context for chart visualization.
    • Enabled multi-post data export functionality.
    • Introduced configurable newsletter subscriptions with list selection.
  • Improvements

    • Enhanced print layouts with optimized visibility and attribution footer.
    • Added scrollspy navigation component for section anchors.
    • Updated theme override system for print and light mode rendering.
    • Improved chart interactions and mobile carousel support.

…ncies

- Introduced a new Labor Automation Hub page with sections for activity monitoring, job statistics, and methodology.
- Added new components including ActivityCard, InfoPopover, LaborHubHeader, and TabGroup for enhanced UI functionality.
- Integrated new data structures for risk and job forecasts.
- Included new images for partner logos and added the `react-scrollspy-navigation` package for scroll navigation.
- Updated package.json and package-lock.json to reflect new dependencies.
- Removed `react-scrollspy-navigation` from package.json and package-lock.json as it was not utilized in the project.
- Updated the Tailwind configuration to support a more complex dark mode strategy.
- Refactored the Labor Automation Hub page to incorporate new UI components such as DualPaneSectionCard, TableCompact, and HeroSection for improved layout and functionality.
- Enhanced the LaborHubHeader and TabGroup components for better navigation experience.
- Introduced InvertedThemeContainer for managing theme context in the application.
- Deleted unused partner images: `renphil-dark.png`, `renphil-light.webp`, and `sff-light.png`.
- Updated `layout.tsx` to include `TailwindIndicator` for development visibility.
- Refactored `LaborAutomationHubPage` to integrate `LaborHubNavigation` for improved navigation and layout consistency.
- Removed `LaborHubHeader` and `LaborHubInfo` components, streamlining the page structure.
- Enhanced `HeroSection` and `TabGroup` components for better responsiveness and visual appeal.
- Added a new Tailwind configuration file `tailwind.config.prettier.ts` to manage dark mode variants without altering class order.
- Updated `.prettierrc.json` to include the new Tailwind configuration file.
- Refactored `LaborHubNavigation` and `HeroSection` components for improved styling consistency and responsiveness.
- Introduced new OverviewSection and ResearchSection components for better content organization.
- Updated layout and styling for various components, including ActivityMonitorSection and DualPaneSectionCard, to enhance responsiveness and visual appeal.
- Added ContentParagraph component for consistent text formatting across sections.
- Adjusted tab labels and removed outdated sections to reflect current content focus.
…atures

- Introduced BasicQuestion and BarChart components for improved data visualization and interaction.
- Updated LaborAutomationHubPage to utilize new components, enhancing the display of featured posts and questions.
- Refactored ResearchSection to include AI vulnerability ratings and updated employment change data.
- Improved the HeroSection with better SVG attributes for consistency.
- Added QuestionCardContainer for better layout management of question cards.
- Removed the BarChart and QuestionCardContainer components to simplify the structure.
- Introduced a new QuestionCard component for better layout and styling of question-related content.
- Integrated RiskChart into the OverviewSection and ActivityMonitorSection for improved data representation.
- Updated ActivityMonitorSection to utilize the new QuestionCard for displaying projected employment growth.
…tion

- Introduced MultiLineRiskChart for enhanced data visualization of employment changes.
- Updated OverviewSection to include the new chart, replacing the placeholder div for improved content representation.
- Refactored LaborHubNavigation for better styling consistency.
…ance question card components

- Replaced BasicQuestion component with QuestionLoader for improved data fetching and rendering of questions.
- Introduced FlippableQuestionCard for enhanced user interaction with question content.
- Added QuestionCardSkeleton for loading states while fetching question data.
- Updated ActivityMonitorSection to use QuestionLoader for displaying projected employment growth.
- Streamlined question card structure for better maintainability and performance.
…ctionality

- Added a MoreButton to the QuestionCard component, providing users with options to view, export, share, and copy links.
- Updated the QuestionCard to conditionally render the MoreButton based on the new showMoreButton prop.
- Introduced POST_IDS_FILTER in filters to support filtering by IDs in search parameters.
- Enhanced filters logic to handle both array and comma-separated string inputs for IDs.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 20, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR introduces a comprehensive "Labor Automation Hub" feature with a new /labor-hub page, refactors the theme system to use a new PrintOverrideProvider and ThemeOverrideContainer, enhances charts with timeline markers, adds newsletter subscription with multi-list support, extends the data download modal for multiple posts, and updates print styling across components.

Changes

Cohort / File(s) Summary
Theme System Refactoring
src/contexts/force_light_context.tsx, src/contexts/theme_override_context.tsx, src/hooks/use_app_theme.ts, src/app/(main)/layout.tsx, src/app/(storefront)/layout.tsx, tailwind.config.ts
Removed ForceLightProvider and replaced with new PrintOverrideProvider (handles beforeprint/afterprint events) and ThemeOverrideContainer (scoped theme overrides). Updated useThemeOverride hook and theme computation logic to support "light" and "inverted" overrides. Changed theme selectors in Tailwind config to exclude both .dark and .force-light classes.
Labor Hub Page & Core Layout
src/app/(main)/labor-hub/page.tsx, src/app/(main)/labor-hub/data.ts, src/app/(main)/labor-hub/activity_data.tsx, src/app/(main)/labor-hub/helpers/...
New Labor Automation Hub page with metadata, composed of hero section, navigation, multiple content sections (Overview, Jobs, Wages, Education, Economy, Research, State, Methodology), and engagement section. Includes supporting data constants (GOVERNMENT_BASELINES, JOBS_DATA, METHODOLOGY_SECTIONS), activity data with timeline markers, and helpers for data fetching and formatting.
Labor Hub Section Components
src/app/(main)/labor-hub/sections/hero.tsx, src/app/(main)/labor-hub/sections/overview.tsx, src/app/(main)/labor-hub/sections/activity_monitor.tsx, src/app/(main)/labor-hub/sections/activity_monitor_interactive.tsx, src/app/(main)/labor-hub/sections/jobs_monitor.tsx, src/app/(main)/labor-hub/sections/jobs_monitor_server.tsx, src/app/(main)/labor-hub/sections/research.tsx, src/app/(main)/labor-hub/sections/methodology.tsx, src/app/(main)/labor-hub/sections/engagement_section.tsx, src/app/(main)/labor-hub/sections/sortable_research_table.tsx
Nine section components rendering different labor automation hub areas: hero with graphics, overview with employment forecasts and job vulnerability charts, activity monitor with timeline integration, jobs monitor with year/growth filters, research table with sortable columns, methodology with FAQs, and engagement cards (newsletter, sharing, partners). Server and client components work together to fetch and display data.
Labor Hub Question & Chart Components
src/app/(main)/labor-hub/components/question_cards/question.tsx, src/app/(main)/labor-hub/components/question_cards/basic_question.tsx, src/app/(main)/labor-hub/components/question_cards/question_card.tsx, src/app/(main)/labor-hub/components/question_cards/flippable_question_card.tsx, src/app/(main)/labor-hub/components/question_cards/flippable_multi_question_card.tsx, src/app/(main)/labor-hub/components/question_cards/flippable_multi_question_card_client.tsx, src/app/(main)/labor-hub/components/question_cards/multi_question_table.tsx, src/app/(main)/labor-hub/components/question_cards/multi_question_line_chart.tsx, src/app/(main)/labor-hub/components/question_cards/multi_question_line_chart_client.tsx, src/app/(main)/labor-hub/components/question_cards/multi_line_chart.tsx, src/app/(main)/labor-hub/components/question_cards/multi_line_chart.types.ts, src/app/(main)/labor-hub/components/question_cards/chart_core/multi_line_chart_model.ts, src/app/(main)/labor-hub/components/question_cards/placeholder.tsx
Comprehensive question card ecosystem with flippable card designs (toggling between table/chart views), multi-question support for comparing across labor categories, complex MultiLineChart component with data labels, legend, highlighted series, and timeline marker integration. Includes chart model computation for axis scaling, tick generation, and label placement. Server and client components handle data fetching and formatting.
Labor Hub UI & Support Components
src/app/(main)/labor-hub/components/section.tsx, src/app/(main)/labor-hub/components/labor_hub_navigation.tsx, src/app/(main)/labor-hub/components/scrollspy_button_group.tsx, src/app/(main)/labor-hub/components/activity_card.tsx, src/app/(main)/labor-hub/components/labor_hub_by_job_vulnerability_card.tsx, src/app/(main)/labor-hub/components/labor_hub_chart_hover_context.tsx, src/app/(main)/labor-hub/components/labor_hub_multi_line_chart.tsx, src/app/(main)/labor-hub/components/mobile_carousel.tsx, src/app/(main)/labor-hub/components/newsletter_subscribe_card.tsx, src/app/(main)/labor-hub/components/newsletter_subscribe_popover.tsx, src/app/(main)/labor-hub/components/overview_mobile_card_tabs.tsx, src/app/(main)/labor-hub/components/definition_tooltip.tsx, src/app/(main)/labor-hub/components/print_attribution.tsx, src/app/(main)/labor-hub/components/table_compact.tsx
Layout and utility components including section wrappers with responsive grid, sticky navigation with newsletter popover, mobile carousel, activity cards with hover variants, chart hover context provider, tooltip definitions, print attribution, and compact table styling. Newsletter subscribe components handle form state and list key routing.
Chart Timeline & Marker System
src/components/charts/primitives/timeline_markers/types.ts, src/components/charts/primitives/timeline_markers/group_timeline_markers_overlay.tsx, src/components/charts/group_chart.tsx, src/app/(main)/questions/[id]/components/group_timeline.tsx, src/app/(main)/questions/[id]/components/multiple_choices_chart_view/index.tsx
Added GroupTimelineMarker type and overlay component for rendering timeline markers on charts. Enhanced GroupChart and MultiChoicesChartView to accept marker configuration props (timelineMarkers, activeTimelineMarkerId, onTimelineMarkerEnter/Leave). Refactored chart padding and geometry computation to support marker overlay positioning.
Newsletter & Subscription
src/app/(main)/actions.ts, src/services/api/misc/misc.server.ts, next.config.mjs
Extended subscribeToNewsletter action to accept optional listKey parameter, mapping it to specific newsletter list IDs via new NEWSLETTER_LIST_IDS constant. Updated server API to pass through overrideListId to Mailjet. Added temporary redirect from /labor-automation to /labor-hub.
Data Download & Filtering
src/app/(main)/questions/[id]/components/download_question_data_modal/index.tsx, src/app/(main)/questions/helpers/filters.ts, src/constants/posts_feed.ts, src/types/utils.ts, utils/serializers.py, utils/views.py
Changed data download modal from single-post to multi-post support via `postId: number
Print & Display Styling
src/app/(main)/components/feedback_float.tsx, src/app/(main)/components/cookies_banner/index.tsx, src/app/(main)/components/footer.tsx, src/app/(main)/components/headers/header.tsx, src/components/ui/section_toggle.tsx, src/components/ui/checkbox.tsx, src/components/ui/tailwind-indicator.tsx, src/components/ui/scrollspy.tsx, package.json
Added print:hidden utility class to floating feedback, cookies banner, footer, and header components to hide from print output. Updated SectionToggle to read print mode via usePrintOverride() and force open state during print with break-inside-avoid and border styling. Added TailwindIndicator component for responsive breakpoint visualization in development. Added Scrollspy component for anchor-based navigation and history management. Added html-to-image dependency for PNG export functionality. Enhanced checkbox label styling with text color utilities.
UI & Utility Updates
src/components/post_actions/post_dropdown_menu.tsx, src/components/detailed_question_card/detailed_question_card/multiple_choice_chart_card.tsx, src/hooks/share.ts, src/app/layout.tsx, src/app/(main)/labor-hub/components/question_cards/continuous_question_prediction.tsx, src/app/(main)/components/MetaculusTextLogo.tsx
Updated post dropdown menu to pass scalar postId and title to data request modal. Added optional hideTitle prop to multiple choice chart card. Updated share hooks to use PUBLIC_APP_URL instead of window.location.origin and switched Twitter endpoint from twitter.com to x.com. Added TailwindIndicator to root layout. Added optional chartHeight prop to continuous question prediction. Removed SVG clipping from Metaculus text logo.

Sequence Diagram(s)

sequenceDiagram
    participant User as User/Browser
    participant Page as Labor Hub Page
    participant Sections as Section Components
    participant API as Data APIs
    participant Chart as Chart Components
    participant Hover as Chart Hover Context

    User->>Page: Visit /labor-hub
    Page->>API: Fetch overall employment data
    Page->>API: Fetch jobs data with forecasts
    API-->>Page: Return forecasted data
    Page->>Sections: Render with data
    
    Sections->>Chart: Initialize charts with data
    Chart->>Hover: Provide hover context
    
    User->>Chart: Hover over chart point
    Chart->>Hover: Update hoverYear state
    Hover-->>Chart: Broadcast hover state
    Chart->>Chart: Highlight series/envelope
    
    User->>Sections: Hover over activity marker
    Sections->>Hover: Set hoveredActivityId
    Hover-->>Chart: Activity highlight syncs
    Chart->>Chart: Display marker styling
    
    User->>Sections: Switch mobile tab
    Sections->>Hover: Clear hoverYear/highlightedEnvelope
    Chart->>Chart: Reset highlight state
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~65 minutes

Possibly related PRs

  • Add the Newsletter section to the homepage #4221: Both PRs evolve the newsletter subscription system, with this PR extending subscribeToNewsletter to accept listKey parameter for multi-list support building on prior newsletter infrastructure.
  • Metaculus Storefront #4522: Related theme system changes—the prior PR introduced ForceLightProvider while this PR removes it and replaces with PrintOverrideProvider and ThemeOverrideContainer.
  • Redesigned Aggregation Explorer #4398: Both PRs modify the GroupChart component, with this PR adding timeline marker props and overlay rendering alongside prior padding/value handling adjustments.

Suggested reviewers

  • ncarazon

Poem

🐰 A labor hub springs forth with care,
Charts dance with markers floating there,
Themes transform with print-mode grace,
Timeline whispers mark the space—
From hopping paths, new forecasts bloom! 📊✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/labor-hub-page

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 20, 2026

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-04-16T19:09:50Z

- Refactored `MoreButton` and `QuestionCard` components to support multiple post IDs for actions like viewing, exporting, and sharing.
- Enhanced the `QuestionCard` footer to include Metaculus attribution with the current date.
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: 4

🧹 Nitpick comments (3)
front_end/src/app/(main)/labor-hub/components/question_cards/multi_question_line_chart.tsx (1)

224-238: Avoid repeated filtering/index lookup in historical tick thinning.

Lines 230-232 rebuild and scan historical columns for every tick. Precomputing an index map once will reduce overhead and simplify the predicate.

♻️ Refactor sketch
+  const historicalIndexByLabel = new Map(
+    dataset.columns
+      .filter((column) => historicalLabelSet.has(column))
+      .map((column, idx) => [column, idx] as const)
+  );
+
   const visibleXTickValues =
     historicalTickEvery && historicalTickEvery > 1
       ? xTickValues.filter((xTickValue) => {
           const label = xTickLabelsByValue[String(xTickValue)];
           if (!label || !historicalLabelSet.has(label)) return true;
-
-          const historicalIndex = dataset.columns
-            .filter((column) => historicalLabelSet.has(column))
-            .indexOf(label);
+          const historicalIndex = historicalIndexByLabel.get(label);

           return (
-            historicalIndex === -1 ||
+            historicalIndex == null ||
             historicalIndex % historicalTickEvery === 0
           );
         })
       : xTickValues;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@front_end/src/app/`(main)/labor-hub/components/question_cards/multi_question_line_chart.tsx
around lines 224 - 238, The filter for visibleXTickValues repeatedly rebuilds
and searches dataset.columns for each tick; fix by precomputing a map of
historical column label -> index once (e.g. before computing visibleXTickValues)
using dataset.columns.filter(...) and building an object or Map, then in the
predicate for visibleXTickValues use that lookup (referencing
historicalLabelSet, xTickLabelsByValue, and historicalTickEvery) to get
historicalIndex instead of calling .filter(...).indexOf(label) each time; ensure
the predicate still returns true when label is missing or historicalIndex %
historicalTickEvery === 0.
front_end/src/app/(main)/labor-hub/components/labor_hub_navigation.tsx (1)

26-31: Narrow newsletterListKey to the supported list keys.

newsletterListKey?: string lets typos compile. In front_end/src/app/(main)/actions.ts:17-24, an unknown key becomes undefined, and front_end/src/services/api/misc/misc.server.ts:105-122 then falls back to the default Mailjet list. That silently subscribes Labor Hub users to the wrong audience instead of failing fast. Please type this as a shared NewsletterListKey/keyof typeof NEWSLETTER_LIST_IDS.

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

In `@front_end/src/app/`(main)/labor-hub/components/labor_hub_navigation.tsx
around lines 26 - 31, The prop newsletterListKey on the LaborHubNavigation
component is too permissive (string) causing silent fallback to the default
Mailjet list; narrow its type to the shared union type (e.g., NewsletterListKey
or keyof typeof NEWSLETTER_LIST_IDS) and import that type where the component is
declared, then update any callers to pass only that typed key; ensure the shared
type is the same one used by the logic in actions.ts and misc.server.ts so
unknown keys become a compile error rather than runtime undefined/fallback.
front_end/src/app/(main)/labor-hub/components/question_cards/multi_line_chart.tsx (1)

532-534: Keep badge formatting and axis formatting decoupled.

Line 534 makes formatYValue the implicit fallback for formatYTick. That couples two separate props, and the badge formatter also feeds computeMultiLineChartModel(), so a caller can't change badge text without also affecting tick text and left-padding calculation.

Proposed fix
   const formatResolvedYValue = formatYValueProp ?? defaultFormatYValue;
-  const formatResolvedYTick =
-    formatYTick ?? formatYValueProp ?? defaultFormatYTick;
+  const formatResolvedYTick = formatYTick ?? defaultFormatYTick;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@front_end/src/app/`(main)/labor-hub/components/question_cards/multi_line_chart.tsx
around lines 532 - 534, formatResolvedYTick currently falls back to
formatYValueProp, coupling badge/label formatting with axis tick formatting;
change formatResolvedYTick so it only uses formatYTick or defaultFormatYTick
(i.e., remove formatYValueProp from the tick fallback) and ensure
computeMultiLineChartModel continues to receive the badge formatter
(formatYValueProp) separately so callers can change badge text without affecting
axis ticks or left-padding calculations.
🤖 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)/labor-hub/components/question_cards/multi_line_chart.tsx:
- Around line 517-520: The code builds highlightedX from
highlightedXProp/uncontrolledHighlightedX but usePrintOverride() only suppresses
hover badges, so hover state still affects rendering; create a
renderedHighlightedX that returns null when usePrintOverride() indicates print
mode (or otherwise forces no hover) and replace uses of highlightedX in the
x-tick formatter, x-axis tick emphasis logic, the vertical guide line render,
and DataPointCircle sizing/highlighting with renderedHighlightedX (look for
usages around the x-tick formatter, axis emphasis code, guide line drawing, and
DataPointCircle component calls such as those in the blocks mentioned) so that
in print mode those hover-only visuals are disabled.
- Around line 632-656: The pointer-move handler handleChartMouseMove currently
clears the shared highlight whenever the pointer enters the left/right gutter
(it calls setHighlightedX(null) in the offsetX-out-of-plot branch), which breaks
the shared hover year; update that branch to only clear the highlight when a
prop clearHighlightOnMouseLeave is true (otherwise just return without calling
setHighlightedX), and add clearHighlightOnMouseLeave to the hook dependency
array so the behavior follows the prop passed from labor_hub_multi_line_chart.

In
`@front_end/src/app/`(main)/labor-hub/components/question_cards/multi_question_line_chart.tsx:
- Around line 217-223: historicalLabelSet is currently derived from rows while
the chart builds historical points from dataset.rows, which can cause
divider/tick drift when resolution changes; change the source-of-truth so the
set is built from dataset.rows (i.e., use Object.keys(row.historicalValues ??
{}) for each row in dataset.rows instead of rows) and pass that resulting set
into getHistoricalForecastDividerX along with dataset.columns so divider/tick
logic and the rendered historical points use the same data source (update the
usage of historicalLabelSet, rows, dataset.rows, and
getHistoricalForecastDividerX accordingly).

In `@front_end/src/app/`(main)/labor-hub/components/scrollspy_button_group.tsx:
- Around line 22-29: The buttons are only visually indicating the active section
via the data-active attribute; update the button rendering in
scrollspy_button_group.tsx to mirror that state into an ARIA attribute so
assistive tech can detect it: when the button with
data-scrollspy-anchor={item.id} is marked active (data-active="true"), set
aria-current="location" (and remove/set it when not active) — implement this by
adding a conditional aria-current prop tied to the same active condition used
for the data-active class toggling in the component.

---

Nitpick comments:
In `@front_end/src/app/`(main)/labor-hub/components/labor_hub_navigation.tsx:
- Around line 26-31: The prop newsletterListKey on the LaborHubNavigation
component is too permissive (string) causing silent fallback to the default
Mailjet list; narrow its type to the shared union type (e.g., NewsletterListKey
or keyof typeof NEWSLETTER_LIST_IDS) and import that type where the component is
declared, then update any callers to pass only that typed key; ensure the shared
type is the same one used by the logic in actions.ts and misc.server.ts so
unknown keys become a compile error rather than runtime undefined/fallback.

In
`@front_end/src/app/`(main)/labor-hub/components/question_cards/multi_line_chart.tsx:
- Around line 532-534: formatResolvedYTick currently falls back to
formatYValueProp, coupling badge/label formatting with axis tick formatting;
change formatResolvedYTick so it only uses formatYTick or defaultFormatYTick
(i.e., remove formatYValueProp from the tick fallback) and ensure
computeMultiLineChartModel continues to receive the badge formatter
(formatYValueProp) separately so callers can change badge text without affecting
axis ticks or left-padding calculations.

In
`@front_end/src/app/`(main)/labor-hub/components/question_cards/multi_question_line_chart.tsx:
- Around line 224-238: The filter for visibleXTickValues repeatedly rebuilds and
searches dataset.columns for each tick; fix by precomputing a map of historical
column label -> index once (e.g. before computing visibleXTickValues) using
dataset.columns.filter(...) and building an object or Map, then in the predicate
for visibleXTickValues use that lookup (referencing historicalLabelSet,
xTickLabelsByValue, and historicalTickEvery) to get historicalIndex instead of
calling .filter(...).indexOf(label) each time; ensure the predicate still
returns true when label is missing or historicalIndex % historicalTickEvery ===
0.
🪄 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: 2433e559-12fe-401c-bd9a-763107cc52ed

📥 Commits

Reviewing files that changed from the base of the PR and between 9c8b7ab and 1a436a4.

📒 Files selected for processing (10)
  • front_end/src/app/(main)/labor-hub/components/labor_hub_navigation.tsx
  • front_end/src/app/(main)/labor-hub/components/mobile_carousel.tsx
  • front_end/src/app/(main)/labor-hub/components/question_cards/basic_question.tsx
  • front_end/src/app/(main)/labor-hub/components/question_cards/multi_line_chart.tsx
  • front_end/src/app/(main)/labor-hub/components/question_cards/multi_question_line_chart.tsx
  • front_end/src/app/(main)/labor-hub/components/question_cards/question.tsx
  • front_end/src/app/(main)/labor-hub/components/scrollspy_button_group.tsx
  • front_end/src/app/(main)/labor-hub/page.tsx
  • front_end/src/app/(main)/labor-hub/sections/activity_monitor.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_view/consumer_question_view/prediction/single_question_prediction/continuous_question_prediction.tsx
🚧 Files skipped from review as they are similar to previous changes (5)
  • front_end/src/app/(main)/labor-hub/components/mobile_carousel.tsx
  • front_end/src/app/(main)/labor-hub/components/question_cards/question.tsx
  • front_end/src/app/(main)/labor-hub/page.tsx
  • front_end/src/app/(main)/labor-hub/sections/activity_monitor.tsx
  • front_end/src/app/(main)/labor-hub/components/question_cards/basic_question.tsx

Comment on lines +517 to +520
const highlightedX =
highlightedXProp === undefined
? uncontrolledHighlightedX
: highlightedXProp;
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.

⚠️ Potential issue | 🟡 Minor

Print mode still renders hover artifacts.

usePrintOverride() only suppresses hover badges right now. A non-null highlightedX still changes tick visibility, bolds the active x tick, enlarges points, and draws the guide line, so printing after a hover can bake a transient active year into the chart.

Proposed fix
   const highlightedX =
     highlightedXProp === undefined
       ? uncontrolledHighlightedX
       : highlightedXProp;
+  const renderedHighlightedX = isPrintMode ? null : highlightedX;

Then use renderedHighlightedX instead of highlightedX anywhere the UI renders hover-only state: the x-tick formatter, x-axis tick emphasis, the vertical guide line, and DataPointCircle.

Also applies to: 664-699, 748-755, 816-831, 919-920

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

In
`@front_end/src/app/`(main)/labor-hub/components/question_cards/multi_line_chart.tsx
around lines 517 - 520, The code builds highlightedX from
highlightedXProp/uncontrolledHighlightedX but usePrintOverride() only suppresses
hover badges, so hover state still affects rendering; create a
renderedHighlightedX that returns null when usePrintOverride() indicates print
mode (or otherwise forces no hover) and replace uses of highlightedX in the
x-tick formatter, x-axis tick emphasis logic, the vertical guide line render,
and DataPointCircle sizing/highlighting with renderedHighlightedX (look for
usages around the x-tick formatter, axis emphasis code, guide line drawing, and
DataPointCircle component calls such as those in the blocks mentioned) so that
in print mode those hover-only visuals are disabled.

Comment thread front_end/src/hooks/share.ts Outdated
Comment thread front_end/src/app/(main)/labor-hub/page.tsx Outdated
Comment thread front_end/src/app/(main)/labor-hub/page.tsx Outdated
Comment thread front_end/src/app/(main)/labor-hub/sections/jobs_monitor.tsx Outdated
Comment thread front_end/src/app/(main)/labor-hub/components/print_attribution.tsx Outdated
Comment thread front_end/src/app/(main)/labor-hub/components/question_cards/question_card.tsx Outdated
@cemreinanc cemreinanc requested a review from ncarazon April 16, 2026 11:10
Copy link
Copy Markdown
Contributor

@ncarazon ncarazon left a comment

Choose a reason for hiding this comment

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

LGTM

@cemreinanc cemreinanc removed the Awaiting QA Live (on prod or dev env), needs QA from the requester to confirm it's working as intended label Apr 16, 2026
@cemreinanc cemreinanc merged commit 03a0f64 into main Apr 16, 2026
14 checks passed
@cemreinanc cemreinanc deleted the feat/labor-hub-page branch April 16, 2026 19:09
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.

4 participants