8000 Catalyst Global Map Polishing by Bryukh · Pull Request #7954 · codecombat/codecombat · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Catalyst Global Map Polishing #7954

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

Closed
wants to merge 5 commits into from

Conversation

Bryukh
Copy link
Collaborator
@Bryukh Bryukh commented Mar 31, 2025

Closes GD-446, GD-567

  • Removed teacher pop up for catalyst
  • Improved alignment for top panel (see screenshot)
  • Removed announcement modals for catalyst

Screenshot 2025-03-31 at 16 42 34

Summary by CodeRabbit

  • Style

    • Improved visual layout with enhanced font sizes, spacing, button dimensions, and alignment for a cleaner campaign view.
    • Updated class names for achievement stars to provide better context and specificity.
  • Refactor

    • Streamlined player level display and refined conditional content visibility, ensuring a more tailored interface for select users.

Bryukh added 3 commits March 31, 2025 15:45
- Added a check to exclude Catalyst users from the anonymous classroom signup prompt, improving user experience and targeting.
- Added a condition to exclude Catalyst users from the anonymous classroom signup prompt, enhancing user targeting and experience.
…er experience

- Increased font size and height for better visibility in the campaign view styles.
- Adjusted margins and display properties for user status elements to improve alignment and responsiveness.
- Simplified the Pug template by removing unnecessary wrapper elements, streamlining the structure.
Copy link
Contributor
coderabbitai bot commented Mar 31, 2025

Walkthrough

This pull request updates the visual styling and control flow within the campaign view. The SASS file now uses adjusted font sizes, heights, margins, and flex layouts for user status elements; the Pug template has been simplified by removing an extra wrapper for the player level; and the JavaScript view now incorporates additional conditions to bypass announcements and the anonymous classroom signup prompt when the isCatalyst flag is true.

Changes

File(s) Change Summary
app/styles/.../campaign-view.sass Updated user status and button styles: increased font sizes and heights, applied flex layout to .user-status-line, adjusted margins for #gems-count and .player-name, modified the hero icon's position and scaling, and reintroduced the level-indicator.
app/templates/.../campaign-view.pug Removed the .rtl-allowed div wrapping the player level display, streamlining the HTML structure.
app/views/.../CampaignView.js Added isCatalyst conditions in maybeShowPendingAnnouncement and shouldShow methods to prevent the display of announcements and anonymous classroom signup prompts for Catalyst users.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant CV as CampaignView
    U->>CV: Navigate to Campaign View
    CV->>CV: Check isCatalyst in maybeShowPendingAnnouncement
    alt isCatalyst true
        CV-->>U: Do not display announcement
    else
        CV->>Announcement: Trigger pending announcement
        Announcement-->>CV: Acknowledge display
        CV-->>U: Show announcement
    end
Loading

Assessment against linked issues

Objective Addressed Explanation
Teacher/Classroom Version Pop-up change [GD-446]
Adjust icons and text in the top right panel [GD-567] No changes related to icons or text in the top right panel were made.

Possibly related PRs

  • Hide CampaignView buttons that shouldn't be there in campaign editor #7830: The changes in the main PR are related to the modifications in the retrieved PR as both involve updates to the campaign-view.pug file, specifically regarding class name changes and conditional rendering logic.
  • we should show level number for challenges too #7814: The changes in the main PR are related to the modifications in the retrieved PR as both involve updates to the Pug template for the campaign view, specifically regarding class names and the display of level-related elements.
  • Vertical global map for Catalyst #7950: The changes in the main PR are related to the modifications in the retrieved PR as both involve updates to the same class name for the star image, changing img.star to img.level-star in the Pug template and renaming .star to .achievements-star in the SASS files.

Suggested reviewers

  • mrfinch
  • smallst

Poem

In a meadow of code, I hop with glee,
Tweaking styles and flows so merrily,
Buttons leap high and icons align,
Conditions check—everything fits just fine,
A joyful code hop from a rabbit so spry,
Celebrating each change as the pixels fly!
🐇✨


📜 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 21117b7 and fcdae07.

📒 Files selected for processing (2)
  • app/styles/play/campaign-view.sass (6 hunks)
  • app/templates/play/campaign-view.pug (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/templates/play/campaign-view.pug
  • app/styles/play/campaign-view.sass
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: ESLint CI
  • GitHub Check: Node.js CI (18.10.0)

🪧 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refines the Catalyst campaign experience by removing certain popups and modals specific to Catalyst users and improving the top panel alignment.

  • Removed the teacher popup and announcement modals for Catalyst.
  • Adjusted logic to bypass anonymous classroom signup for Catalyst users.
Files not reviewed (2)
  • app/styles/play/campaign-view.sass: Language not supported
  • app/templates/play/campaign-view.pug: Language not supported
Comments suppressed due to low confidence (2)

app/views/play/CampaignView.js:2000

  • Ensure that the property 'isCatalyst' is explicitly defined and documented within CampaignView to clarify its intended function and avoid any unintended behavior.
if (this.isCatalyst) { return false }

app/views/play/CampaignView.js:2178

  • Confirm that including '!this.isCatalyst' in the anonymous classroom signup condition correctly prevents Catalyst users from triggering this functionality; adding a brief inline comment may improve clarity on its purpose.
return me.isAnonymous() && !this.isCatalyst &&

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: 0

🧹 Nitpick comments (1)
app/styles/play/campaign-view.sass (1)

1672-1681: New Keyframes "currentPracticeLevel" Introduced
This additional keyframes block introduces a pulse effect for practice level elements, transitioning the box-shadow and text color from white to a sky blue tone (#87CEFF). Verify that the effect complements the overall UI without becoming too distracting during extended usage.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8e4ab08 and 30b1de7.

📒 Files selected for processing (3)
  • app/styles/play/campaign-view.sass (4 hunks)
  • app/templates/play/campaign-view.pug (1 hunks)
  • app/views/play/CampaignView.js (2 hunks)
🔇 Additional comments (11)
app/views/play/CampaignView.js (2)

1999-2000: Skip announcement modals for Catalyst users

The condition added here prevents announcement modals from being shown to users in the Catalyst experiment, which aligns with the PR objective to remove announcement modals for the Catalyst feature.


2177-2180: Prevent classroom signup prompts for Catalyst users

This change prevents anonymous users who are part of the Catalyst experiment from seeing the classroom signup dialog, which meets the PR objective to remove the teacher pop-up for the Catalyst feature.

app/templates/play/campaign-view.pug (1)

552-553: Improved top panel alignment by removing extra wrapper

Removing the .rtl-allowed div wrapper around the player level elements simplifies the DOM structure and improves the alignment of elements in the top panel. This change directly addresses the PR objective to improve the alignment of the top panel.

Note that this change still preserves the right-to-left text support as needed, since the individual spans still display the content correctly.

app/styles/play/campaign-view.sass (8)

22-31: New Keyframes "levelStartedPulse" Added
This new keyframes block defines a pulse effect using dynamic margin and box-shadow values. The use of math.div for calculations is consistent with modern SASS practices. Please verify that these animations perform smoothly across target browsers.


928-933: Catalyst User-Status Adjustments
The .user-status-catalyst block now features an increased font size (26px) and updated dimensions (height and line-height raised to 40px) for a more spacious layout. Confirm that these new dimensions harmonize with other UI elements on various screen sizes.


940-943: Alignment Enhancement via Flexbox
Inside the catalyst’s user-status line, switching to a flex layout with display: flex, align-items: center, and justify-content: flex-end is a solid choice for improved alignment. This change should ensure that status elements line up neatly regardless of content changes.


958-960: Adjusted Positioning for Icons
Changing the positioning for .gem, .player-hero-icon from absolute to relative (with top: auto) helps avoid unintended overlaps and misalignments. This is a thoughtful update to maintain consistency with the catalyst UI modifications.


963-965: Improved Alignment for Gems Count Display
The update to the #gems-count selector—reducing margin-left from 40px to 5px and setting it to use display: inline-flex with centered alignment—should integrate it more naturally with adjacent elements.


967-969: Enhanced Player Level Styling
Adjusting the .player-level with a reduced left margin and applying display: inline-flex with align-items: center reinforces consistency with the overall text alignment in the catalyst status bar.


972-975: Refined Player Name Spacing and Alignment
Reducing the left margin to 5px and adding inline-flex styling with centered alignment for the .player-name ensures better visual coherence with the adjacent elements in the catalyst user-status.


992-995: Updated Hero Icon Scaling and Spacing
The changes to .player-hero-icon—increasing the side margins (to 0px 4px) and applying a transform: scale(1.33) with transform-origin: center center—effectively scale the icon up from 30px to approximately 40px. This ensures the icon is more prominent and visually balanced in the catalyst header.

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: 0

🧹 Nitpick comments (1)
app/styles/common/common.sass (1)

226-232: Descriptive Rename for Achievement Star Element
The updated class .achievements-star is clear and more descriptive than the previous generic .star class. This improves readability and maintainability by clearly indicating the element's purpose.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 30b1de7 and 21117b7.

📒 Files selected for processing (3)
  • app/styles/common/common.sass (1 hunks)
  • app/styles/play/campaign-view.sass (5 hunks)
  • app/templates/play/campaign-view.pug (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/templates/play/campaign-view.pug
  • app/styles/play/campaign-view.sass
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: ESLint CI
  • GitHub Check: Node.js CI (18.10.0)
🔇 Additional comments (4)
app/styles/common/common.sass (4)

234-237: Consistent Modifier for 20px Achievement Star
The modifier &.achievements-star-20 correctly sets the dimensions to 20px by 20px. This change is consistent with the new naming convention and ensures uniform styling for the smallest star variant.


238-241: Consistent Modifier for 30px Achievement Star
The modifier &.achievements-star-30 appropriately defines a 30px by 30px size. It maintains consistency with other modifier classes and supports scalable UI elements for achievement stars.


242-245: Consistent Modifier for 40px Achievement Star
The modifier &.achievements-star-40 specifies the element's dimensions at 40px by 40px. The uniform naming reinforces clarity across multiple size variants.


246-248: Consistent Modifier ACAD for 50px Achievement Star
The modifier &.achievements-star-50 is correctly applied to render a 50px by 50px star element. The dimensional values are consistent with the intended design for larger achievement icons.

@Bryukh Bryukh closed this Apr 2, 2025
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
0