Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename second stage instructions card #2418

Merged
merged 3 commits into from
Nov 22, 2024
Merged

Conversation

rohitpaulk
Copy link
Member

@rohitpaulk rohitpaulk commented Nov 22, 2024

  • Update test runner instructions to reflect user test run status and assertions.
  • Rename second stage instructions card to second stage tutorial card across files.

Summary by CodeRabbit

  • New Features
    • Updated the naming convention for the second stage tutorial card, enhancing clarity and consistency in the user interface.
  • Bug Fixes
    • Adjusted references in tests to ensure proper functionality of the newly named tutorial card.
  • Documentation
    • Updated test cases and component references to reflect the new naming structure, ensuring accurate documentation and test coverage.

Copy link
Contributor

coderabbitai bot commented Nov 22, 2024

Walkthrough

The changes in this pull request primarily involve renaming the SecondStageInstructionsCard component to SecondStageTutorialCard across various files, including templates, component classes, and tests. This renaming reflects a shift in the component's categorization, indicating a transition from an "Instructions" focus to a "Tutorial" focus. The internal logic, functionality, and flow of the components remain unchanged, with updates made to ensure consistency in naming throughout the codebase.

Changes

File Change Summary
app/components/course-page/course-stage-step/second-stage-tutorial-card.hbs Updated component ID from second-stage-instructions-card to second-stage-tutorial-card and renamed nested components accordingly.
app/components/course-page/course-stage-step/second-stage-tutorial-card.ts Renamed SecondStageInstructionsCardComponent to SecondStageTutorialCardComponent and updated the Glint registry entry.
app/components/course-page/course-stage-step/second-stage-tutorial-card/implement-solution-step.ts Updated component registration from SecondStageInstructionsCard::ImplementSolutionStep to SecondStageTutorialCard::ImplementSolutionStep.
app/components/course-page/course-stage-step/second-stage-tutorial-card/read-instructions-step.ts Updated component registration from SecondStageInstructionsCard::ReadInstructionsStep to SecondStageTutorialCard::ReadInstructionsStep.
app/components/course-page/course-stage-step/second-stage-tutorial-card/run-tests-step.ts Updated component registration from SecondStageInstructionsCard::RunTestsStep to SecondStageTutorialCard::RunTestsStep.
app/templates/course/stage/instructions.hbs Renamed SecondStageInstructionsCard to SecondStageTutorialCard in the template for PreviousStepsIncompleteOverlay.
tests/acceptance/course-page/complete-second-stage-test.js Updated test references from secondStageInstructionsCard to secondStageTutorialCard in assertions and interactions.
tests/acceptance/course-page/complete-stage-without-changes-test.js Updated component reference from secondStageInstructionsCard to secondStageTutorialCard in assertions.
tests/acceptance/course-page/course-stage-solutions-test.js Updated references from secondStageInstructionsCard to secondStageTutorialCard in test assertions and interactions.
tests/pages/components/course-page/course-stage-step/second-stage-tutorial-card.ts Updated scope property from '#second-stage-instructions-card' to '#second-stage-tutorial-card'.
tests/pages/course-page.js Updated import and export references from SecondStageInstructionsCard to SecondStageTutorialCard.

Possibly related PRs

🐰 In a world of tutorials bright,
The steps we take are now in sight.
From instructions old, we leap and bound,
To learn and grow, our skills profound.
With every card, a lesson clear,
Let's hop along, no need to fear! 🐇✨


🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 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.

@rohitpaulk rohitpaulk changed the title rename second stage card rename second stage instructions card Nov 22, 2024
@rohitpaulk rohitpaulk force-pushed the rename-second-stage-card branch from a9a394e to 792525f Compare November 22, 2024 18:15
Copy link

github-actions bot commented Nov 22, 2024

Test Results

  1 files  ±0    1 suites  ±0   5m 54s ⏱️ -1s
583 tests ±0  543 ✅ +2  40 💤 ±0  0 ❌ ±0 
598 runs  ±0  558 ✅ +4  40 💤 ±0  0 ❌  - 2 

Results for commit a36a193. ± Comparison against base commit 04dd121.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Nov 22, 2024

Bundle Report

Changes will decrease total bundle size by 190.73kB (-0.53%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
client-array-push 35.87MB 190.73kB (-0.53%) ⬇️

Copy link
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

🧹 Outside diff range and nitpick comments (3)
app/components/course-page/course-stage-step/second-stage-tutorial-card.hbs (1)

Line range hint 9-13: Consider replacing hardcoded statistics with dynamic data

The completion rate is currently hardcoded to 98%, which could become outdated or misleading. As noted in the TODO comment, this should be fetched from the backend.

Would you like me to help create a GitHub issue to track the implementation of dynamic completion rate statistics?

tests/acceptance/course-page/complete-second-stage-test.js (2)

56-57: Consider addressing the TODO comment about tab state retention.

The TODO comment suggests an improvement in UX by retaining expanded/collapsed states after tab switches. This could enhance user experience by maintaining context across tab navigation.

Would you like me to help create a GitHub issue to track this enhancement? I can also assist in implementing the state retention functionality.


85-85: Consider using a more specific assertion.

The current assertion checks if the text contains "To run tests, make changes to your code". Consider using a more precise assertion that matches the exact expected message to avoid potential false positives.

-assert.contains(coursePage.secondStageTutorialCard.steps[2].instructions, 'To run tests, make changes to your code');
+assert.strictEqual(
+  coursePage.secondStageTutorialCard.steps[2].instructions.trim(),
+  'To run tests, make changes to your code'
+);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 04dd121 and a36a193.

📒 Files selected for processing (11)
  • app/components/course-page/course-stage-step/second-stage-tutorial-card.hbs (2 hunks)
  • app/components/course-page/course-stage-step/second-stage-tutorial-card.ts (2 hunks)
  • app/components/course-page/course-stage-step/second-stage-tutorial-card/implement-solution-step.ts (1 hunks)
  • app/components/course-page/course-stage-step/second-stage-tutorial-card/read-instructions-step.ts (1 hunks)
  • app/components/course-page/course-stage-step/second-stage-tutorial-card/run-tests-step.ts (1 hunks)
  • app/templates/course/stage/instructions.hbs (1 hunks)
  • tests/acceptance/course-page/complete-second-stage-test.js (3 hunks)
  • tests/acceptance/course-page/complete-stage-without-changes-test.js (1 hunks)
  • tests/acceptance/course-page/course-stage-solutions-test.js (1 hunks)
  • tests/pages/components/course-page/course-stage-step/second-stage-tutorial-card.ts (1 hunks)
  • tests/pages/course-page.js (2 hunks)
✅ Files skipped from review due to trivial changes (4)
  • app/components/course-page/course-stage-step/second-stage-tutorial-card.ts
  • app/components/course-page/course-stage-step/second-stage-tutorial-card/implement-solution-step.ts
  • app/components/course-page/course-stage-step/second-stage-tutorial-card/read-instructions-step.ts
  • app/components/course-page/course-stage-step/second-stage-tutorial-card/run-tests-step.ts
🔇 Additional comments (14)
tests/pages/components/course-page/course-stage-step/second-stage-tutorial-card.ts (1)

10-10: LGTM! Verify the corresponding template changes.

The scope selector update aligns with the PR objective to rename "second stage instructions card" to "second stage tutorial card".

Let's verify that the corresponding template has been updated with the new ID:

✅ Verification successful

✅ Template ID has been correctly updated

The verification confirms that:

  • The new ID second-stage-tutorial-card exists in app/components/course-page/course-stage-step/second-stage-tutorial-card.hbs
  • No occurrences of the old ID second-stage-instructions-card were found
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the template file uses the new ID

# Search for the new ID in template files
rg -t hbs 'id="second-stage-tutorial-card"'

# Also check for any remaining references to the old ID to ensure complete rename
rg -t hbs 'second-stage-instructions-card'

Length of output: 273

app/components/course-page/course-stage-step/second-stage-tutorial-card.hbs (4)

1-1: LGTM: Component ID updated consistently

The component ID has been updated to align with the new "tutorial" terminology, maintaining consistency with the broader renaming effort.


17-23: LGTM: Component reference updated consistently

The ReadInstructionsStep component reference has been updated to use the new SecondStageTutorialCard namespace while maintaining all necessary props.


24-31: LGTM: Component reference updated consistently

The ImplementSolutionStep component reference has been updated to use the new SecondStageTutorialCard namespace while maintaining all necessary props, including solution visibility control.


Line range hint 32-36: LGTM: Component reference updated consistently

The RunTestsStep component reference has been updated to use the new SecondStageTutorialCard namespace while maintaining all necessary props.

Let's verify that the renaming has been consistently applied across the codebase:

✅ Verification successful

Component renaming has been consistently applied across the codebase

The verification confirms that:

  • No references to the old name SecondStageInstructionsCard exist in the templates
  • The new name SecondStageTutorialCard is consistently used across all relevant template files:
    • app/templates/course/stage/instructions.hbs
    • app/components/course-page/course-stage-step/second-stage-tutorial-card.hbs
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistent renaming from SecondStageInstructionsCard to SecondStageTutorialCard

# Check for any remaining references to the old name
rg "SecondStageInstructionsCard" --type-add 'template:*.{hbs,handlebars}' --type template

# Check for consistent usage of the new name
rg "SecondStageTutorialCard" --type-add 'template:*.{hbs,handlebars}' --type template

Length of output: 752

tests/acceptance/course-page/course-stage-solutions-test.js (2)

42-43: LGTM! Setup phase renaming is consistent.

The component references in the setup phase have been correctly updated to use the new naming convention.


47-47: LGTM! Test assertions maintain proper coverage.

The assertions have been properly updated with the new naming while maintaining comprehensive test coverage of the solution reveal functionality. The Percy snapshots ensure visual regression testing remains intact.

Also applies to: 50-52

tests/acceptance/course-page/complete-stage-without-changes-test.js (1)

77-79: LGTM! Component reference updated correctly.

The renaming from secondStageInstructionsCard to secondStageTutorialCard is consistent with the PR objectives while maintaining the original test assertions.

Let's verify that this renaming is consistent across other test files:

✅ Verification successful

Renaming verified: All references consistently updated

The verification shows that:

  • No instances of the old name secondStageInstructionsCard remain in the codebase
  • The new name secondStageTutorialCard is consistently used across all test files:
    • tests/pages/course-page.js (component definition)
    • tests/acceptance/course-page/complete-stage-without-changes-test.js
    • tests/acceptance/course-page/course-stage-solutions-test.js
    • tests/acceptance/course-page/complete-second-stage-test.js
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistent renaming across test files
# Expect: No remaining references to the old name in test files

# Search for any remaining references to the old name
rg -g '*.js' -g '*.ts' "secondStageInstructionsCard"

# Search for the new name to confirm proper adoption
rg -g '*.js' -g '*.ts' "secondStageTutorialCard"

Length of output: 7409

app/templates/course/stage/instructions.hbs (1)

Line range hint 40-47: LGTM! Component renamed successfully.

The renaming from SecondStageInstructionsCard to SecondStageTutorialCard is implemented correctly while maintaining all component properties and conditional rendering logic.

tests/acceptance/course-page/complete-second-stage-test.js (3)

40-45: LGTM! Comprehensive initial state assertions.

The assertions thoroughly verify both completion and expansion states for all three steps, maintaining consistency with the component renaming.


95-100: LGTM! Thorough completion state verification.

The assertions comprehensively verify the final state, ensuring all steps are complete and properly collapsed after submission.


137-139: LGTM! Proper CLI submission handling.

The assertions correctly verify the completion state for CLI submissions, maintaining consistency with the git-based submission test case.

tests/pages/course-page.js (2)

14-14: LGTM! Import statement updated correctly.

The import statement has been properly updated to reflect the new component name, maintaining consistency with the renaming initiative.


203-203: LGTM! Property name updated consistently.

The property name has been updated to match the new component name, maintaining consistency with the import change and the overall renaming initiative.

@@ -37,7 +37,7 @@
{{/if}}

{{#if @model.courseStage.isSecond}}
<CoursePage::CourseStageStep::SecondStageInstructionsCard
<CoursePage::CourseStageStep::SecondStageTutorialCard
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Inconsistency found in service methods still using old naming

The component has been renamed to SecondStageTutorialCard, but the service methods in course-page-state.ts still use the old naming convention with "Instructions":

  • manuallyCompletedStepIdsInSecondStageInstructions
  • recordManuallyCompletedStepInSecondStageInstructions

These methods should be renamed to maintain consistency with the new "Tutorial" naming.

🔗 Analysis chain

Verify consistent renaming across the codebase.

Let's ensure the renaming is consistent across all references, including documentation and test files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to the old component name
# and verify the new name is used consistently.

echo "Checking for any remaining references to SecondStageInstructionsCard..."
rg -i "SecondStageInstructions"

echo "\nVerifying consistent usage of new component name..."
rg -i "SecondStageTutorial"

echo "\nChecking documentation files..."
fd -e md -e mdx -e hbs | xargs rg -i "stage.*(instructions|tutorial)"

Length of output: 14611

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.

1 participant