Skip to content

chore: fix banner on close#334

Merged
dinwwwh merged 1 commit intomainfrom
chore/fix-banner-on-close
Apr 5, 2025
Merged

chore: fix banner on close#334
dinwwwh merged 1 commit intomainfrom
chore/fix-banner-on-close

Conversation

@dinwwwh
Copy link
Copy Markdown
Member

@dinwwwh dinwwwh commented Apr 5, 2025

Summary by CodeRabbit

  • New Features
    • The banner now adapts more effectively to your window size by using overall screen dimensions for layout calculations. This update ensures a more consistent and responsive display experience on larger screens.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
orpc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 5, 2025 2:47pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2025

Walkthrough

This change updates the Banner.vue component by separating how the width and height are obtained. The width is now derived using the useWindowSize composable, while the height continues to be obtained from useElementSize(container). The computed property layoutTopHeight and the control flow within the watchEffect remain unchanged, except for the modified source of the width value.

Changes

File(s) Change Summary
apps/content/.../Banner.vue Updated to separate dimension retrieval: width is now obtained using useWindowSize, while height continues to be fetched using useElementSize(container). The computed property and watchEffect logic remain unchanged.

Sequence Diagram(s)

sequenceDiagram
    participant B as Banner.vue Component
    participant W as useWindowSize
    participant E as useElementSize (Container)
    participant V as watchEffect
    participant CSS as CSS Variable Setter

    B->>W: Retrieve window width
    B->>E: Retrieve container height
    B->>B: Compute layoutTopHeight
    alt if window width >= 960
        B->>V: Trigger watchEffect
        V->>CSS: Set CSS variable with layoutTopHeight
    end
Loading

Possibly related PRs

  • unnoq/orpc#301: Modifies visibility logic and styling in the Banner.vue component, complementing the changes in how the width is determined within the same file.

Poem

I'm the rabbit, hopping by,
With code changes soaring high,
Window width now steals the show,
While container height calmly flows,
Hopping along where logic lies—
A cheerful code tale under open skies!
🐇✨


📜 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 aa59d19 and 2cb3b93.

📒 Files selected for processing (1)
  • apps/content/.vitepress/theme/components/Banner.vue (1 hunks)
🔇 Additional comments (1)
apps/content/.vitepress/theme/components/Banner.vue (1)

2-2: Good change for reliable responsive behavior.

The refactoring to use useWindowSize() for width instead of getting it from the container element is a solid improvement. This change ensures that the responsive behavior in the watchEffect function is based on the actual window size rather than the container dimensions, which is more reliable for setting the CSS variable correctly.

The separation of concerns is clean - using window size for responsive checks while still using element size for layout height calculations.

Also applies to: 7-8


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
  • @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.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 5, 2025

More templates

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@334

@orpc/client

npm i https://pkg.pr.new/@orpc/client@334

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@334

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@334

@orpc/openapi-client

npm i https://pkg.pr.new/@orpc/openapi-client@334

@orpc/react

npm i https://pkg.pr.new/@orpc/react@334

@orpc/react-query

npm i https://pkg.pr.new/@orpc/react-query@334

@orpc/server

npm i https://pkg.pr.new/@orpc/server@334

@orpc/solid-query

npm i https://pkg.pr.new/@orpc/solid-query@334

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@334

@orpc/standard-server

npm i https://pkg.pr.new/@orpc/standard-server@334

@orpc/standard-server-fetch

npm i https://pkg.pr.new/@orpc/standard-server-fetch@334

@orpc/standard-server-node

npm i https://pkg.pr.new/@orpc/standard-server-node@334

@orpc/svelte-query

npm i https://pkg.pr.new/@orpc/svelte-query@334

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@334

@orpc/vue-colada

npm i https://pkg.pr.new/@orpc/vue-colada@334

@orpc/vue-query

npm i https://pkg.pr.new/@orpc/vue-query@334

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@334

commit: 2cb3b93

@dinwwwh dinwwwh merged commit 85cc28f into main Apr 5, 2025
8 checks passed
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