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

Launch Split Up Git Commands For Stage 1 experiment #2544

Merged
merged 7 commits into from
Jan 17, 2025
Merged

Conversation

andy1li
Copy link
Member

@andy1li andy1li commented Jan 17, 2025

Checklist:

  • I've thoroughly self-reviewed my changes
  • I've added tests for my changes, unless they affect admin-only areas (or are otherwise not worth testing)
  • I've verified any visual changes using Percy (add a commit with [percy] in the message to trigger)

Summary by CodeRabbit

  • New Features

    • Enhanced Git command instructions with split-view option for Stage 1.
    • Added dynamic filename retrieval for tutorial cards.
  • Bug Fixes

    • Removed unused terminal instructions tracking.
  • Chores

    • Updated component interfaces to support new feature flag functionality.
    • Introduced modal management for Git command instructions.

@andy1li andy1li self-assigned this Jan 17, 2025
Copy link
Contributor

coderabbitai bot commented Jan 17, 2025

Walkthrough

This pull request introduces modifications to the course stage tutorial components, focusing on the SubmitCodeStep and related files. The changes enhance the Git command instructions by adding conditional rendering for split Git commands, integrating feature flags, and removing tracking of terminal instruction clicks. The modifications provide more detailed guidance for users during the course stages, with a particular emphasis on improving the first-stage tutorial card's functionality.

Changes

File Change Summary
app/components/course-page/course-stage-step/first-stage-tutorial-card.hbs Updated component instantiation to include @courseStage and @filename attributes
app/components/course-page/course-stage-step/first-stage-tutorial-card.ts Removed isTerminalInstructionsPingingClicked property, added filename computed property
app/components/course-page/course-stage-step/first-stage-tutorial-card/submit-code-step.hbs Added conditional rendering for split Git commands based on feature flag
app/components/course-page/course-stage-step/first-stage-tutorial-card/submit-code-step.ts Added feature flags service, new tracked properties, and modal handling methods
app/components/course-page/course-stage-step/second-stage-tutorial-card.ts Removed isTerminalInstructionsPingingClicked property and related method
app/services/feature-flags.js Added canSeeSplitUpGitCommandsForStage1 getter method

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • rohitpaulk

Poem

🐰 Coding rabbits hop with glee,
Git commands split, now we can see!
Feature flags wave their magic wand,
Of terminal mysteries, we're now fond!
Refactoring code with playful might,
Our tutorial steps now shine so bright! 🚀


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c91036c and 9dc691e.

📒 Files selected for processing (1)
  • app/components/course-page/course-stage-step/first-stage-tutorial-card/submit-code-step.hbs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/components/course-page/course-stage-step/first-stage-tutorial-card/submit-code-step.hbs
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

@andy1li andy1li changed the title Launch Show Split Up Git Commands For Stage 1 experiment Launch Split Up Git Commands For Stage 1 experiment Jan 17, 2025
Copy link

codecov bot commented Jan 17, 2025

Bundle Report

Changes will increase total bundle size by 36.06MB (100.0%) ⬆️⚠️, exceeding the configured threshold of 5%.

Bundle name Size Change
client-array-push 36.06MB 36.06MB (100%) ⬆️⚠️

Copy link

github-actions bot commented Jan 17, 2025

Test Results

  1 files  ±0    1 suites  ±0   6m 21s ⏱️ -3s
595 tests ±0  554 ✅ ±0  41 💤 ±0  0 ❌ ±0 
610 runs  ±0  569 ✅ ±0  41 💤 ±0  0 ❌ ±0 

Results for commit 9dc691e. ± Comparison against base commit 0e11451.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Jan 17, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
555 1 554 41
View the full list of 1 ❄️ flaky tests
Chrome 131.0 Integration | Component | code-mirror &gt; Options &gt; filename: it doesn't break the editor when passed

Flake rate in main: 42.86% (Passed 4 times, Failed 3 times)

Stack Traces | 5.06s run time
Test took longer than 5000ms; test timed out.

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@andy1li
Copy link
Member Author

andy1li commented Jan 17, 2025

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

🧹 Nitpick comments (6)
app/components/course-page/course-stage-step/first-stage-tutorial-card/submit-code-step.ts (1)

29-31: Consider removing unnecessary getter.

The currentCourse getter simply forwards courseStage.course. Consider using this.args.courseStage.course directly where needed, unless this getter serves a specific purpose not apparent from the context.

app/components/course-page/course-stage-step/first-stage-tutorial-card/submit-code-step.hbs (5)

8-8: Consider providing more guidance on commit messages.

The example [any message] might be too vague for beginners. Consider providing a more meaningful example or explaining commit message best practices.

-    <CopyableTerminalCommand @commands={{array 'git commit -am "[any message]"'}} class="mb-3" />
+    <CopyableTerminalCommand @commands={{array 'git commit -am "implement stage 1 solution"'}} class="mb-3" />

15-15: Add more context to the example output.

The example output shows numbers that might vary for users. Consider adding a note explaining that the specific numbers and hash may differ.


126-126: Avoid hardcoding avatar URLs.

The avatar URL should be provided through a configuration or component property rather than being hardcoded. This makes it easier to update and maintain.


171-171: Extract forum URL template to a constant.

The forum URL template with query parameters is duplicated. Consider extracting it to a constant or helper function for better maintainability.

Also applies to: 118-118


83-84: Enhance modal accessibility.

Consider adding:

  1. aria-label for the modal backdrop
  2. role="dialog" and aria-labelledby attributes for the modal body
  3. Keyboard focus trap within the modal

Also applies to: 136-137

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0e11451 and c91036c.

📒 Files selected for processing (6)
  • app/components/course-page/course-stage-step/first-stage-tutorial-card.hbs (1 hunks)
  • app/components/course-page/course-stage-step/first-stage-tutorial-card.ts (1 hunks)
  • app/components/course-page/course-stage-step/first-stage-tutorial-card/submit-code-step.hbs (2 hunks)
  • app/components/course-page/course-stage-step/first-stage-tutorial-card/submit-code-step.ts (1 hunks)
  • app/components/course-page/course-stage-step/second-stage-tutorial-card.ts (0 hunks)
  • app/services/feature-flags.js (1 hunks)
💤 Files with no reviewable changes (1)
  • app/components/course-page/course-stage-step/second-stage-tutorial-card.ts
🔇 Additional comments (4)
app/services/feature-flags.js (1)

17-19: LGTM! Well-implemented feature flag.

The implementation follows existing patterns and correctly handles null safety with the optional chaining operator.

app/components/course-page/course-stage-step/first-stage-tutorial-card/submit-code-step.ts (1)

4-7: LGTM! Well-structured component changes.

The changes follow TypeScript best practices, properly implement modal state management, and cleanly integrate the feature flag.

Also applies to: 12-13, 20-41

app/components/course-page/course-stage-step/first-stage-tutorial-card.hbs (1)

24-28: LGTM! Clean template updates.

The template changes correctly reflect the component interface updates with proper attribute passing.

app/components/course-page/course-stage-step/first-stage-tutorial-card/submit-code-step.hbs (1)

Line range hint 1-186: Overall implementation looks good! 👍

The split Git commands feature is well-implemented with comprehensive error handling and clear user guidance. The suggested improvements above are enhancements that can be addressed in follow-up PRs.

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