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

Design prototype for concept completed modal #2654

Merged
merged 2 commits into from
Feb 21, 2025
Merged

Design prototype for concept completed modal #2654

merged 2 commits into from
Feb 21, 2025

Conversation

rohitpaulk
Copy link
Member

@rohitpaulk rohitpaulk commented Feb 13, 2025

Implement a modal that when a user completes a concept,
specifically for anonymous users. The modal encourages users to sign
in with GitHub to access additional content. This enhances user
engagement and provides a clear call to action for further
interaction with the platform.

Summary by CodeRabbit

  • New Features
    • Introduced a celebratory modal that appears when a concept is completed.
    • The modal displays a congratulatory message with a celebratory emoji and a prominent “Sign in with GitHub” button, allowing users to unlock additional content.
    • A clear disclaimer informs users about the limited data (username, avatar, email) collected during GitHub sign-in.
    • The modal is conditionally shown, ensuring a tailored experience for users who have completed the concept while remaining anonymous.

Implement a modal that when a user completes a concept, 
specifically for anonymous users. The modal encourages users to sign 
in with GitHub to access additional content. This enhances user 
engagement and provides a clear call to action for further 
interaction with the platform.
Copy link
Contributor

coderabbitai bot commented Feb 13, 2025

Walkthrough

This pull request introduces a new modal component for displaying a concept completion message. It adds both a Handlebars template for the modal’s UI and a corresponding TypeScript file for its logic, including type definitions and a Glint registry entry. The modal features a celebratory message with an emoji, a GitHub sign-in button (with an SVG icon), and a data disclaimer. Additionally, the content template is updated to conditionally render this modal for anonymous users who have completed a concept.

Changes

File(s) Description
app/components/concept-page/concept-completed-modal.{hbs, ts} Added new modal component with celebratory messaging, GitHub sign-in button (including SVG icon), data disclaimer, component logic, and registry.
app/components/…/content.hbs Updated to conditionally render the modal when a user has completed the concept and is authenticated as an anonymous user.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant CP as Concept Page
    participant AT as Authenticator
    participant CM as Completed Modal

    U->>CP: Completes concept
    CP->>AT: Check user authentication status
    AT-->>CP: Returns anonymous status
    CP->>CM: Render Completed Modal with concept data
    U->>CM: Click "Sign in with GitHub"
    CM->>AT: Trigger GitHub authentication flow
Loading

Possibly related PRs

Poem

Oh, I’m a rabbit, happy and spry,
Hopping through code as the modals fly!
A celebratory popup, gleefully bright,
Invites a GitHub sign in with pure delight.
In fields of flexbox and typed surprises galore,
I celebrate changes forevermore!
🐇✨


📜 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 5e6843d and 4e4c04c.

📒 Files selected for processing (1)
  • app/components/concept-page/concept-completed-modal.hbs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/components/concept-page/concept-completed-modal.hbs
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test

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

Copy link

github-actions bot commented Feb 13, 2025

Test Results

  1 files  ±0    1 suites  ±0   6m 25s ⏱️ - 1m 28s
617 tests ±0  576 ✅ +1  41 💤 ±0  0 ❌ ±0 
632 runs  ±0  591 ✅ +2  41 💤 ±0  0 ❌  - 1 

Results for commit 4e4c04c. ± Comparison against base commit 4303bee.

♻️ This comment has been updated with latest results.

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 (1)
app/components/concept-page/content.hbs (1)

25-67: Consider consolidating duplicate completion messages.

There appears to be duplicate "concept completed" messaging:

  1. The new modal (lines 25-29)
  2. The existing completion message (lines 31-67)

Consider:

  1. Showing only the modal for anonymous users
  2. Showing only the existing message for authenticated users

Update the conditional logic:

 {{#if (and this.hasCompletedConcept this.authenticator.isAnonymous)}}
   <ModalBackdrop>
     <ConceptPage::ConceptCompletedModal @concept={{@concept}} />
   </ModalBackdrop>
 {{/if}}

-{{#animated-if this.hasCompletedConcept}}
+{{#animated-if (and this.hasCompletedConcept (not this.authenticator.isAnonymous))}}
   <div class="flex flex-col gap-y-16 border-t pt-12" {{scroll-into-view block="start"}}>
     <!-- ... -->
   </div>
 {{/animated-if}}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4303bee and 5e6843d.

📒 Files selected for processing (3)
  • app/components/concept-page/concept-completed-modal.hbs (1 hunks)
  • app/components/concept-page/concept-completed-modal.ts (1 hunks)
  • app/components/concept-page/content.hbs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test
🔇 Additional comments (5)
app/components/concept-page/concept-completed-modal.ts (2)

4-10: LGTM! Well-defined type signature.

The type definition is clear and properly typed with the required concept argument and HTMLDivElement element type.


12-18: LGTM! Component is properly registered.

The component is correctly set up with type safety through Glint registry.

app/components/concept-page/concept-completed-modal.hbs (2)

1-13: LGTM! Clear and well-structured modal layout.

The modal has a clean layout with proper spacing and visual hierarchy.


24-26: LGTM! Clear data usage disclaimer.

The disclaimer about GitHub data usage is clear and transparent.

app/components/concept-page/content.hbs (1)

25-29: LGTM! Proper conditional rendering.

The modal is correctly rendered only for anonymous users who have completed the concept.

Comment on lines 14 to 23
<PrimaryButton @size="large">
<div class="flex items-center gap-x-2">
{{svg-jar "github" class="fill-current w-4"}}

<span>
Sign in with GitHub
</span>
</div>
</PrimaryButton>

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add click handler for GitHub sign-in button.

The button is missing an action to handle the GitHub sign-in flow.

Add the click handler to initiate GitHub authentication:

-<PrimaryButton @size="large">
+<PrimaryButton @size="large" {{on "click" this.handleGitHubSignIn}}>

Don't forget to implement the corresponding action in the TypeScript file:

@action
handleGitHubSignIn() {
  // Implement GitHub sign-in flow
}

Copy link

codecov bot commented Feb 13, 2025

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 Feb 13, 2025

Bundle Report

Changes will increase total bundle size by 3.76kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
client-array-push 36.19MB 3.76kB (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/chunk.*.js -1 bytes 234.06kB -0.0%
assets/chunk.*.js -1 bytes 53.02kB -0.0%
assets/chunk.*.js 352 bytes 24.86kB 1.44%
assets/chunk.*.js 378 bytes 24.51kB 1.57%
assets/chunk.*.js 5 bytes 62.46kB 0.01%
assets/chunk.*.js 1 bytes 12.04kB 0.01%
assets/chunk.*.js 5 bytes 107.91kB 0.0%
assets/chunk.*.js 150 bytes 24.13kB 0.63%
assets/chunk.*.js 8 bytes 403.1kB 0.0%
assets/chunk.*.js 404 bytes 23.98kB 1.71%
assets/chunk.*.js 54 bytes 30.8kB 0.18%
assets/chunk.*.js 335 bytes 23.58kB 1.44%
assets/chunk.*.js 13 bytes 161.86kB 0.01%
assets/chunk.*.js 393 bytes 23.24kB 1.72%
assets/chunk.*.js 31 bytes 30.74kB 0.1%
assets/chunk.*.js 1.63kB 2.44MB 0.07%

Refactor the concept completed modal to enhance user experience. 
Adjust the text to clarify the data requested from GitHub and 
improve the layout by adding a gradient background and 
increasing the button icon size. These changes aim to provide 
a more visually appealing and informative interface for users 
completing the concept.
@rohitpaulk rohitpaulk changed the title feat: add concept completion modal for anonymous users Design prototype Feb 13, 2025
@rohitpaulk rohitpaulk changed the title Design prototype Design prototype for concept completed modal Feb 13, 2025
@ryan-gang ryan-gang merged commit 4e4c04c into main Feb 21, 2025
8 of 9 checks passed
@ryan-gang ryan-gang deleted the pk-branch-4 branch February 21, 2025 13:50
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