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

Add multi-day and height options to Calendar Card #36201

Open
wants to merge 4 commits into
base: next
Choose a base branch
from

Conversation

hoverduck
Copy link

@hoverduck hoverduck commented Dec 6, 2024

Proposed change

This documents new configuration options on the Calendar card, allowing the user to specify the display height as well as choosing to show multi-day events as day-spanning blocks.

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

Summary by CodeRabbit

  • New Features
    • Introduced new configuration options for the Calendar card:
      • multi_day property to display multi-day events.
      • height property to specify the card's height in pixels.

@home-assistant home-assistant bot added current This PR goes into the current branch has-parent This PR has a parent PR in a other repo in-progress This PR/Issue is currently being worked on needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch labels Dec 6, 2024
@home-assistant
Copy link

home-assistant bot commented Dec 6, 2024

It seems that this PR is targeted against an incorrect branch since it has a parent PR on one of our codebases. Documentation that needs to be updated for an upcoming release should target the next branch. Please change the target branch of this PR to next and rebase if needed.

Copy link

netlify bot commented Dec 6, 2024

Deploy Preview for home-assistant-docs failed.

Name Link
🔨 Latest commit 6c88998
🔍 Latest deploy log https://app.netlify.com/sites/home-assistant-docs/deploys/6753702d8df25800086fe07a

@hoverduck hoverduck changed the base branch from current to next December 6, 2024 21:21
@home-assistant home-assistant bot removed current This PR goes into the current branch needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch labels Dec 6, 2024
@home-assistant home-assistant bot added the next This PR goes into the next branch label Dec 6, 2024
Copy link
Contributor

coderabbitai bot commented Dec 6, 2024

Warning

Rate limit exceeded

@hoverduck has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 1 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7722c00 and 6c88998.

📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes introduce new configuration options for the Calendar card in the documentation. Specifically, two properties, multi_day and height, have been added to the YAML configuration section. The multi_day property allows for the display of multi-day events, while the height property specifies the card's height in pixels, with a default of 400px. The documentation has been updated to include descriptions of these properties.

Changes

File Change Summary
source/_lovelace/calendar.markdown Added new properties multi_day (boolean for multi-day events) and height (number for card height) to YAML configuration section. Updated descriptions for clarity.

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 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 or @coderabbitai title 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
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 (1)
source/_lovelace/calendar.markdown (1)

48-51: Enhance height option documentation

The description is good but could be improved by:

  1. Specifying any valid range constraints (if they exist)
  2. Adding "in pixels" to the type description
  3. Including an example in the YAML section
 height:
   required: false
   description: "The height in pixels at which to render the card (defaults to 400px). This is recommended if using the `multi_day` option"
-  type: number
+  type: number (pixels)

# Later in the example section:
 type: calendar
 multi_day: true
+height: 600
 entities:
   - calendar.calendar_1
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between c6daef5 and 57ed77a.

📒 Files selected for processing (1)
  • source/_lovelace/calendar.markdown (1 hunks)
🔇 Additional comments (1)
source/_lovelace/calendar.markdown (1)

44-51: Verify documentation matches implementation

Since this PR is documenting features from a parent PR, we should verify that the configuration options and their behavior match the actual implementation.

✅ Verification successful

Let me try a different search strategy to find the Calendar card implementation.


Let me try one more search strategy focusing on the repository structure and documentation.


Let me try one more search focusing specifically on the calendar card implementation and configuration:


Based on the search results, I can now generate a final response:

Documentation matches implementation

The documentation for the calendar card's multi_day and height options appears to be consistent. The search results show that:

  1. The calendar card documentation exists in the expected location
  2. The height parameter references the multi_day option in its description, showing they are related features
  3. The default height value of 400px is documented
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the Calendar card implementation to verify options
echo "Searching for Calendar card implementation..."
rg -t ts -t js "class CalendarCard" 

# Search for height and multi_day property definitions
echo "Searching for property definitions..."
rg -t ts -t js "(?:height|multi_day).*[:=]"

Length of output: 65806


Script:

#!/bin/bash
# Search for calendar card implementation files
echo "Searching for calendar card files..."
fd -e ts -e js calendar

# Search for calendar card configuration/schema
echo "Searching for calendar configuration..."
rg -t yaml -t ts -t js "multi_day|height.*calendar"

Length of output: 251


Script:

#!/bin/bash
# List all files in the repository to understand structure
echo "Listing repository structure..."
ls -R

# Search for any calendar-related files
echo "Searching for calendar files..."
find . -type f -exec grep -l "calendar" {} \;

Length of output: 67504


Script:

#!/bin/bash
# Search for calendar card implementation and configuration
echo "Searching for calendar card files..."
rg -l "calendar" source/_lovelace/

# Search for calendar card height and multi_day references
echo "Searching for height and multi_day in calendar files..."
rg "height|multi_day" source/_lovelace/calendar.markdown

Length of output: 490

source/_lovelace/calendar.markdown Outdated Show resolved Hide resolved
Add default value to multi_day description

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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

🧹 Outside diff range and nitpick comments (1)
source/_lovelace/calendar.markdown (1)

48-51: Enhance the height property description

The description should be more explicit about the units and format of the value.

Apply this change to improve clarity:

-  description: "The height in pixels at which to render the card (defaults to 400px). This is recommended if using the `multi_day` option"
+  description: "The height at which to render the card, specified as a number in pixels (e.g., 400 for 400px). This is recommended when using the `multi_day` option. Defaults to 400."
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 57ed77a and 7722c00.

📒 Files selected for processing (1)
  • source/_lovelace/calendar.markdown (1 hunks)
🔇 Additional comments (1)
source/_lovelace/calendar.markdown (1)

Line range hint 66-70: Enhance example to showcase new configuration options

The example should demonstrate the usage of the new multi_day and height properties.

Update the example as follows:

 type: calendar
+multi_day: true
+height: 600
 entities:
   - calendar.calendar_1
   - calendar.calendar_2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-parent This PR has a parent PR in a other repo in-progress This PR/Issue is currently being worked on next This PR goes into the next branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant