Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 9, 2025

This PR migrates the frontend from Blueprint v5 to v6, implementing all required breaking changes as outlined in the Blueprint v6 migration guide.

Changes Made

Dependencies Updated

  • @blueprintjs/core: ^5.10.1 → ^6.0.0
  • @blueprintjs/select: ^5.1.3 → ^6.0.0
  • @blueprintjs/datetime: Added ^6.0.0 (replaces datetime2)
  • @blueprintjs/datetime2: Removed (deprecated in v6)
  • @blueprintjs/icons: Already on ^6.0.0

Breaking Changes Fixed

CSS Namespace

  • Updated CSS namespace from bp5- to bp6- in SCSS variables

Icon Component

  • Replaced deprecated iconSize prop with size prop across all Icon usages
  • Updated 6+ files with Icon components

DatePicker Components

  • Migrated from @blueprintjs/datetime2 to @blueprintjs/datetime
  • Updated DateInput3DateInput imports
  • Fixed onChange callback signature changes: (date?: Date) => void(selectedDate: Date | null, isUserChange: boolean) => void

TextArea Component

  • Replaced deprecated growVertically prop with autoResize prop

External Dependencies Removed

  • Removed conductor, language-directory, and xlsx dependencies as they were causing installation failures
  • Created stub implementations to maintain functionality where needed
  • These dependencies can be re-added later if needed

Testing

  • ✅ Application builds successfully
  • ✅ Development server starts without errors
  • ✅ UI components render correctly with Blueprint v6
  • ✅ All Blueprint-specific breaking changes addressed

Remaining Issues

8 pre-existing TypeScript errors remain that are unrelated to Blueprint migration:

  • 5 CopyToClipboard JSX component type issues
  • 2 SyntaxHighlighter JSX component type issues
  • 1 File upload handler type mismatch

These errors existed before the migration and are not caused by Blueprint v6 changes.

The migration successfully updates all Blueprint ecosystem dependencies and applies the necessary breaking changes, ensuring compatibility with Blueprint v6 while maintaining existing functionality.

Fixes #3288.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.sheetjs.com
    • Triggering command: node /usr/local/bin/yarn install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Summary by CodeRabbit

  • New Features

    • Upgraded BlueprintJS packages to version 6, introducing the latest UI components and improvements.
  • Bug Fixes

    • Improved date selection handling to prevent issues when clearing dates in editors.
    • Updated textarea in the markdown editor to automatically resize for better usability.
  • Style

    • Updated icon size prop usage for consistency across the app.
    • Changed global style namespace to match BlueprintJS v6.
  • Chores

    • Updated code formatting and linting configurations for better compatibility and consistency.

Copy link
Contributor Author

Copilot AI commented Aug 9, 2025

@RichDom2185 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI changed the title [WIP] Migrate to BlueprintJS v6 Migrate to BlueprintJS v6 Aug 9, 2025
Copilot AI requested a review from RichDom2185 August 9, 2025 09:31
Copilot finished work on behalf of RichDom2185 August 9, 2025 09:31
Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@RichDom2185 RichDom2185 marked this pull request as ready for review August 9, 2025 13:32
@RichDom2185 RichDom2185 enabled auto-merge (squash) August 9, 2025 13:33
@RichDom2185 RichDom2185 disabled auto-merge August 9, 2025 13:34
@RichDom2185 RichDom2185 enabled auto-merge (squash) August 9, 2025 13:35
@RichDom2185 RichDom2185 requested a review from sayomaki August 9, 2025 14:03
@sayomaki
Copy link
Contributor

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Aug 10, 2025

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link

coderabbitai bot commented Aug 10, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

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

Walkthrough

This pull request upgrades the project to BlueprintJS v6, updating relevant dependencies, component imports, and prop usages to match breaking changes. It replaces deprecated BlueprintJS packages and components, updates SCSS namespace variables, and modifies usage of props such as iconSize and growVertically to their v6 equivalents across multiple files.

Changes

Cohort / File(s) Change Summary
BlueprintJS Dependency Updates
package.json
Upgraded @blueprintjs/core, @blueprintjs/datetime2 (replaced with @blueprintjs/datetime), and @blueprintjs/select to v6. Fixed version for @sourceacademy/sharedb-ace.
SCSS Namespace Update
src/styles/_global.scss
Changed global SCSS namespace variable $ns from 'bp5' to 'bp6'.
Date Component Migration
src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx
Switched import and usage from DateInput3 in @blueprintjs/datetime2 to DateInput in @blueprintjs/datetime.
Icon Prop Update
src/commons/achievement/AchievementFilter.tsx, src/commons/achievement/AchievementView.tsx, src/commons/assessment/Assessment.tsx, src/commons/editingOverviewCard/EditingOverviewCard.tsx, src/commons/mobileWorkspace/mobileSideContent/MobileSideContent.tsx
Replaced deprecated iconSize prop with size in all BlueprintJS <Icon> usages.
DatePicker onChange Handling
src/commons/achievement/control/achievementEditor/EditableDate.tsx, src/commons/achievement/control/goalEditor/EditableDate.tsx
Updated onChange handler to pass undefined instead of falsy values (e.g., null) to changeDate callback.
TextArea Prop Update
src/commons/sideContent/content/githubAssessments/SideContentMarkdownEditor.tsx
Replaced deprecated growVertically prop with autoResize in <TextArea>.
Formatter & Linter Config
.prettierrc, eslint.config.mjs
Added endOfLine: auto to Prettier config; reordered some import statements in ESLint config.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ReactComponent
    participant BlueprintJS_v6

    User->>ReactComponent: Interacts with UI (e.g., clicks, edits)
    ReactComponent->>BlueprintJS_v6: Uses updated components/props (e.g., Icon size, DateInput)
    BlueprintJS_v6-->>ReactComponent: Renders updated UI elements
    ReactComponent-->>User: Displays UI with BlueprintJS v6 changes
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Assessment against linked issues

Objective Addressed Explanation
Update all Blueprint ecosystem dependencies to Blueprint v6 (#3288)
Apply migrations as per the migration guide above (#3288)
Update the CSS namespace (in the scss variable) from bp5 to bp6 (#3288)
Remove usage of deprecated BlueprintJS props/components (iconSize, growVertically, etc.) (#3288)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Poem

A hop, a skip, a Blueprint fix,
From five to six, we made the switch!
Icons resized and dates anew,
SCSS namespace fresh as dew.
The code now shines, the UI too—
This rabbit’s proud of what you do! 🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/fix-3288

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 2

🔭 Outside diff range comments (2)
eslint.config.mjs (1)

51-53: Remove deprecated/removed TypeScript-ESLint rules

@typescript-eslint/interface-name-prefix and @typescript-eslint/camelcase are long-removed and will cause “Definition for rule … was not found” errors. Drop them.

Apply:

-      '@typescript-eslint/interface-name-prefix': 'off',
-      '@typescript-eslint/camelcase': 'off',
src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx (1)

54-57: Fix null handling: on clearing the DateInput, dayjs(null) sets “now” instead of preserving null

Currently, when the user clears the input, onChange receives null, but dayjs(null) produces the current time. This makes newDate never null, so the “No date and time selected!” branch will not trigger, and you may inadvertently save “now”.

  • Preserve null in state when selectedDate is null.
  • Also pass null (not undefined) to the controlled value prop when there’s no date.
-  const handleDateChange = React.useCallback(
-    (selectedDate: string | null) => setNewDate(dayjs(selectedDate)),
-    []
-  );
+  const handleDateChange = React.useCallback(
+    (selectedDate: string | null) => setNewDate(selectedDate ? dayjs(selectedDate) : null),
+    []
+  );
@@
-      value={newDate?.toISOString()}
+      value={newDate ? newDate.toISOString() : null}

Also applies to: 65-79

🧹 Nitpick comments (5)
.prettierrc (1)

6-7: End-of-line handling: consider normalizing via .gitattributes

endOfLine: "auto" can lead to cross-OS line-ending churn. Either set "lf" here or add a .gitattributes to normalize line endings repo-wide.

Suggested .gitattributes:

* text=auto eol=lf
src/commons/sideContent/content/githubAssessments/SideContentMarkdownEditor.tsx (1)

41-41: Use controlled input to avoid uncontrolled/controlled drift

Since you update content on change, prefer value={content} over defaultValue for consistency and to prevent stale UI when content changes externally.

Apply:

-        <TextArea onChange={onEditorChange} fill={true} autoResize={true} defaultValue={content} />
+        <TextArea onChange={onEditorChange} fill={true} autoResize={true} value={content} />
src/commons/mobileWorkspace/mobileSideContent/MobileSideContent.tsx (1)

40-40: Use consistent constant naming to avoid confusion with removed prop name

Prop rename to size is correct for Blueprint v6. Minor nit: the local constant is still named iconSize, which can be misleading now that the prop is size. Rename for clarity.

Apply:

-  const iconSize = 20;
+  const ICON_SIZE = 20;
...
-        <Icon icon={tab.iconName} size={iconSize} />
+        <Icon icon={tab.iconName} size={ICON_SIZE} />

Also applies to: 27-27

src/commons/achievement/control/achievementEditor/EditableDate.tsx (1)

13-15: Nit: Avoid stale state in toggle by using functional updater

Use the functional form to prevent potential stale closures if multiple toggles happen quickly.

-  const toggleOpen = () => setOpen(!isOpen);
+  const toggleOpen = () => setOpen(prev => !prev);
src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx (1)

20-21: Nit: Off-by-one day in minDate

new Date(2010, 0, 0) resolves to 2009-12-31. If you intend Jan 1, 2010, use day 1.

-  const minDate = new Date(2010, 0, 0);
+  const minDate = new Date(2010, 0, 1);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 35209d7 and 1de1953.

⛔ Files ignored due to path filters (22)
  • src/commons/__tests__/__snapshots__/ContentDisplay.test.tsx.snap is excluded by !**/*.snap
  • src/commons/__tests__/__snapshots__/Markdown.test.tsx.snap is excluded by !**/*.snap
  • src/commons/assessment/__tests__/__snapshots__/Assessment.test.tsx.snap is excluded by !**/*.snap
  • src/commons/assessmentWorkspace/__tests__/__snapshots__/AssessmentWorkspace.test.tsx.snap is excluded by !**/*.snap
  • src/commons/dropdown/__tests__/__snapshots__/Dropdown.test.tsx.snap is excluded by !**/*.snap
  • src/commons/navigationBar/__tests__/__snapshots__/NavigationBar.test.tsx.snap is excluded by !**/*.snap
  • src/commons/navigationBar/subcomponents/__tests__/__snapshots__/AcademyNavigationBar.test.tsx.snap is excluded by !**/*.snap
  • src/commons/navigationBar/subcomponents/__tests__/__snapshots__/NavigationBarLangSelectButton.test.tsx.snap is excluded by !**/*.snap
  • src/commons/navigationBar/subcomponents/__tests__/__snapshots__/SicpNavigationBar.test.tsx.snap is excluded by !**/*.snap
  • src/commons/repl/__tests__/__snapshots__/Repl.test.tsx.snap is excluded by !**/*.snap
  • src/commons/sideContent/__tests__/__snapshots__/SideContentAutograder.test.tsx.snap is excluded by !**/*.snap
  • src/commons/sideContent/__tests__/__snapshots__/SideContentContestLeaderboard.test.tsx.snap is excluded by !**/*.snap
  • src/commons/sideContent/__tests__/__snapshots__/SideContentContestVoting.test.tsx.snap is excluded by !**/*.snap
  • src/commons/sideContent/__tests__/__snapshots__/SideContentCseMachine.test.tsx.snap is excluded by !**/*.snap
  • src/features/sicp/errors/__tests__/__snapshots__/SicpErrors.test.tsx.snap is excluded by !**/*.snap
  • src/features/sicp/parser/__tests__/__snapshots__/ParseJson.test.tsx.snap is excluded by !**/*.snap
  • src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap is excluded by !**/*.snap
  • src/pages/sicp/subcomponents/__tests__/__snapshots__/CodeSnippet.test.tsx.snap is excluded by !**/*.snap
  • src/pages/sicp/subcomponents/__tests__/__snapshots__/SicpExercise.test.tsx.snap is excluded by !**/*.snap
  • src/pages/sicp/subcomponents/__tests__/__snapshots__/SicpIndexPage.test.tsx.snap is excluded by !**/*.snap
  • src/pages/sicp/subcomponents/__tests__/__snapshots__/SicpToc.test.tsx.snap is excluded by !**/*.snap
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (13)
  • .prettierrc (1 hunks)
  • eslint.config.mjs (1 hunks)
  • package.json (1 hunks)
  • src/commons/achievement/AchievementFilter.tsx (1 hunks)
  • src/commons/achievement/AchievementView.tsx (1 hunks)
  • src/commons/achievement/control/achievementEditor/EditableDate.tsx (1 hunks)
  • src/commons/achievement/control/goalEditor/EditableDate.tsx (1 hunks)
  • src/commons/assessment/Assessment.tsx (1 hunks)
  • src/commons/editingOverviewCard/EditingOverviewCard.tsx (1 hunks)
  • src/commons/mobileWorkspace/mobileSideContent/MobileSideContent.tsx (1 hunks)
  • src/commons/sideContent/content/githubAssessments/SideContentMarkdownEditor.tsx (1 hunks)
  • src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx (2 hunks)
  • src/styles/_global.scss (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/commons/assessment/Assessment.tsx (1)
src/commons/utils/DateHelper.ts (2)
  • beforeNow (16-20)
  • getPrettyDate (32-36)
🔇 Additional comments (11)
package.json (3)

34-37: PR summary inconsistency: dependencies claimed removed still present

PR summary mentions removing problematic deps (conductor, language-directory, xlsx), but they are still listed (Lines 56, 70, 110). Please confirm intent and either remove them or adjust the summary.

If removal is intended, also search for usages to ensure stubs cover them:

#!/bin/bash
rg -n --hidden --glob '!node_modules' \
  "from ['\"](conductor|language-directory|xlsx)['\"]|require\\(['\"](conductor|language-directory|xlsx)['\"]\\)" -S

Likely an incorrect or invalid review comment.


44-44: Pinned version change — confirm rationale

@sourceacademy/sharedb-ace is pinned to 2.1.1 (previously a range per summary). If the pin is to avoid install breaks, consider adding a comment in package.json or a Renovate/Dependabot rule to revisit later.


34-37: No deprecated @blueprintjs/datetime2 imports remain

Verified that there are no occurrences of @blueprintjs/datetime2 in the codebase. The Blueprint v6 dependency upgrade is complete.

eslint.config.mjs (1)

7-7: Import position change is fine

No functional impact; import order here is non-semantic in flat config.

src/commons/sideContent/content/githubAssessments/SideContentMarkdownEditor.tsx (1)

41-41: Correct prop migration: growVerticallyautoResize

The v6 prop change is applied correctly.

src/commons/achievement/AchievementView.tsx (1)

62-62: LGTM: Icon prop migration

Using size={60} is correct for Blueprint v6. No issues spotted.

src/commons/achievement/AchievementFilter.tsx (1)

22-22: LGTM: Icon prop migration

Prop rename to size={30} is correct. Looks good.

src/commons/editingOverviewCard/EditingOverviewCard.tsx (1)

116-116: LGTM: Icon prop migration

Prop rename to size={12} is correct for Blueprint v6.

src/commons/achievement/control/achievementEditor/EditableDate.tsx (1)

35-39: LGTM: DatePicker v6 onChange null handling is correct

Mapping null to undefined keeps changeDate’s (date?: Date) contract intact and avoids passing falsy values through.

src/commons/achievement/control/goalEditor/EditableDate.tsx (1)

35-39: LGTM: DatePicker v6 onChange null handling is correct

Consistently mapping null to undefined aligns with the updated API and your changeDate signature.

src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx (1)

2-2: No residual @blueprintjs/datetime2 or v3 component references detected

I ran the provided grep scans for @blueprintjs/datetime2, DateInput3, DatePicker3, RangeInput3, TimezoneSelect, and TimezonePicker—no matches were found. The migration to Blueprint v6’s DateInput appears complete.

@RichDom2185 RichDom2185 disabled auto-merge August 10, 2025 03:26
@RichDom2185 RichDom2185 enabled auto-merge (squash) August 10, 2025 03:26
@RichDom2185 RichDom2185 disabled auto-merge August 10, 2025 03:26
@RichDom2185 RichDom2185 enabled auto-merge (squash) August 10, 2025 03:26
Copy link
Contributor

@sayomaki sayomaki left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@RichDom2185 RichDom2185 merged commit 66024de into master Aug 10, 2025
10 checks passed
@RichDom2185 RichDom2185 deleted the copilot/fix-3288 branch August 10, 2025 06:27
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.

Migrate to BlueprintJS v6

3 participants