Skip to content

Conversation

@discreted66
Copy link
Collaborator

@discreted66 discreted66 commented Apr 9, 2025

PR

日历视图详细时间支持配置隐藏

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features
    • Introduced a new configuration option in the calendar view that lets users toggle the display of schedule tip times. This enhancement offers greater control over how and when schedule tips are shown across both desktop and mobile interfaces, improving overall customization for viewing events.

@coderabbitai
Copy link

coderabbitai bot commented Apr 9, 2025

Walkthrough

A new Boolean property to control the display of schedule tip time has been added to the calendar view component. The changes update both the demos and the core Vue component code by introducing the property using two different naming conventions (show-tip-time in the demo and showTipTime in the Vue source). The property is integrated in the component’s configuration object and used to conditionally render event time information in both the mobile-first and PC variants.

Changes

File(s) Change Summary
examples/.../apis/calendar-view.js Added new property show-tip-time to the component props with Boolean type, default value true, descriptive texts in Chinese and English, and applicable meta data.
packages/vue/.../src/index.ts Introduced new property showTipTime in the calendarViewProps object with a Boolean type and a default value of true.
packages/vue/.../src/mobile-first.vue
packages/vue/.../src/pc.vue
Added showTipTime to the component props and applied conditional rendering (v-if) for tip time display; ensures event tip time is only shown when the property is true.

Sequence Diagram(s)

sequenceDiagram
    participant CV as CalendarView Component
    participant PT as showTipTime Prop

    CV->>PT: Retrieve property value
    alt showTipTime is true
        CV->>CV: Render schedule tip time
    else showTipTime is false
        CV->>CV: Skip rendering tip time
    end
Loading

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • zzcr

Poem

I'm a rabbit in the code, hopping with cheer,
Adding a new property that now appears clear.
With a toggle in place, the tip time can hide,
Conditional magic on mobile and PC side.
My little code carrots now dance with delight—
Hop along to the rhythm of this feature tonight!
🐇💻

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


📜 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 28016cb and 12169f8.

📒 Files selected for processing (4)
  • examples/sites/demos/apis/calendar-view.js (1 hunks)
  • packages/vue/src/calendar-view/src/index.ts (1 hunks)
  • packages/vue/src/calendar-view/src/mobile-first.vue (2 hunks)
  • packages/vue/src/calendar-view/src/pc.vue (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: PR Unit Test
  • GitHub Check: PR E2E Test (pnpm test:e2e3)
🔇 Additional comments (6)
packages/vue/src/calendar-view/src/mobile-first.vue (2)

7-7: Conditionally rendering time information based on showTipTime prop

The added v-if directive appropriately implements the configuration option for hiding time information in the tooltip. This change aligns with the PR objective to make the time display configurable.


373-375: Added showTipTime property to component props

The showTipTime property is correctly added to the props list, enabling the conditional rendering used on line 7. This maintains component configurability and is consistent with the implementation in other files.

packages/vue/src/calendar-view/src/index.ts (1)

84-87: Added showTipTime property definition

The property is correctly defined as a Boolean with a default value of true, which ensures backward compatibility. This definition aligns with the property's usage in both the mobile-first.vue and pc.vue components.

packages/vue/src/calendar-view/src/pc.vue (2)

219-219: Conditionally rendering date information based on showTipTime prop

The added v-if directive correctly implements the same behavior as in the mobile version, ensuring consistent functionality across both variants of the calendar component.


287-289: Added showTipTime property to component props

The showTipTime property is properly added to the props list, enabling the conditional rendering used on line 219. This maintains consistency with the mobile-first implementation and the properties defined in index.ts.

examples/sites/demos/apis/calendar-view.js (1)

152-165: Added show-tip-time property documentation

The new property is well-documented with appropriate type, default value, and descriptions in both Chinese and English. Including the stability version (3.23.0) is helpful for users to understand when this feature was introduced.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

@github-actions github-actions bot added the enhancement New feature or request (功能增强) label Apr 9, 2025
@petercat-assistant
Copy link

Walkthrough

此PR为日历视图组件添加了一个新功能,允许用户配置是否显示日程提示时间。通过引入一个新的布尔属性showTipTime,用户可以选择隐藏或显示日程提示中的时间信息。

Changes

文件 概要
examples/sites/demos/apis/calendar-view.js 添加了show-tip-time属性的API描述,包括其类型、默认值和描述信息。
packages/vue/src/calendar-view/src/index.ts 在组件属性中添加了showTipTime属性,默认值为true
packages/vue/src/calendar-view/src/mobile-first.vue 使用v-if条件渲染来控制日程提示时间的显示。
packages/vue/src/calendar-view/src/pc.vue 使用v-if条件渲染来控制日程提示时间的显示。

<div class="p-2 max-h-[80vh] overflow-auto">
<div class="px-1.5 mb-1.5 border-l-2 border-color-brand">{{ state.eventTipContent.title }}</div>
<div class="mb-1.5 px-2 text-color-text-placeholder">
<div v-if="showTipTime" class="mb-1.5 px-2 text-color-text-placeholder">

Choose a reason for hiding this comment

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

Ensure that showTipTime is properly initialized and passed down to this component to avoid potential runtime errors if it is undefined.

<div class="tooltip-main">
<div class="title">{{ state.eventTipContent.title }}</div>
<div class="date">
<div v-if="showTipTime" class="date">

Choose a reason for hiding this comment

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

Ensure that showTipTime is properly initialized and passed down to this component to avoid potential runtime errors if it is undefined.

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Walkthrough

This PR adds a new feature to the Calendar View component, allowing users to configure whether to display schedule prompts. By introducing a new Boolean property showTipTime, the user can choose to hide or display time information in the schedule prompt.

Changes

Documents Summary
examples/sites/demos/apis/calendar-view.js Added API description for the show-tip-time attribute, including its type, default value, and description information.
packages/vue/src/calendar-view/src/index.ts Added the showTipTime property to the component properties, the default value is true.
packages/vue/src/calendar-view/src/mobile-first.vue Use v-if conditional rendering to control the display of schedule prompt time.
packages/vue/src/calendar-view/src/pc.vue Use v-if conditional rendering to control the display of schedule prompt time.

@discreted66 discreted66 changed the title feat:[calendar-view]The calendar view tip time support configure feat(calendar-view):[calendar-view]The calendar view tip time support configure Apr 9, 2025
@zzcr zzcr merged commit bec9bbd into opentiny:dev Apr 11, 2025
12 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request (功能增强)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants