Skip to content

fix: defaultValue of contentPadding #6232

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 4 commits into from

Conversation

wyc001122
Copy link
Contributor

@wyc001122 wyc001122 commented May 19, 2025

Description

I am very sorry, I accidentally set the padding incorrectly to 16

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

Checklist

ℹ️ Check all checkboxes - this will indicate that you have done everything in accordance with the rules in CONTRIBUTING.

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs:dev command.
  • Run the tests with pnpm test.
  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • New Features

    • Added new layout customization options, including content width, padding (overall and per side), and z-index.
    • Introduced configurable height settings for the header and footer.
    • Enhanced sidebar configuration with additional width options for collapsed and mixed states.
  • Documentation

    • Updated guides to reflect new layout and dimension configuration options.

Copy link

changeset-bot bot commented May 19, 2025

⚠️ No Changeset found

Latest commit: 8bb8c9f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented May 19, 2025

Walkthrough

This update introduces new layout and dimension configuration properties to the preferences system, including additional padding, width, height, and z-index controls for app, header, footer, and sidebar sections. These are reflected across default values, TypeScript interfaces, documentation, and Vue template bindings, enhancing layout customization without altering existing logic.

Changes

File(s) Change Summary
packages/@core/preferences/src/config.ts Added new default layout and dimension properties (padding, width, height, zIndex) to app, footer, header, and sidebar.
packages/@core/preferences/src/types.ts Extended AppPreferences, FooterPreferences, HeaderPreferences, and SidebarPreferences interfaces with new numeric properties.
docs/src/en/guide/essentials/settings.md,
docs/src/guide/essentials/settings.md
Updated documentation and interface declarations to reflect new layout-related configuration options.
packages/effects/layouts/src/basic/layout.vue Added new prop bindings for layout customization (paddings, widths, heights, zIndex) in the layout component template.

Poem

In the warren of code, new spaces appear,
With paddings and widths now perfectly clear.
Heights for the header, the footer, the side—
A z-index hop for the UI to glide!
With every new number, the layout feels right,
A rabbit’s delight in the softest moonlight.
🐇✨

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.

✨ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this 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 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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 2efacb3 and c14a16d.

⛔ Files ignored due to path filters (1)
  • packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (5)
  • docs/src/en/guide/essentials/settings.md (8 hunks)
  • docs/src/guide/essentials/settings.md (8 hunks)
  • packages/@core/preferences/src/config.ts (4 hunks)
  • packages/@core/preferences/src/types.ts (4 hunks)
  • packages/effects/layouts/src/basic/layout.vue (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: post-update (windows-latest)
  • GitHub Check: post-update (ubuntu-latest)
🔇 Additional comments (19)
packages/effects/layouts/src/basic/layout.vue (4)

183-188: Good addition of fine-grained content padding controls.

These new props provide more detailed control over the content area's layout, allowing for both a uniform padding value and individual control of each side when needed.


191-192: Nice addition of height controls for footer and header.

Adding explicit height controls for the footer and header components improves layout consistency and supports better responsive design.


207-210: Improved sidebar dimension controls.

The addition of extraCollapsedWidth, mixedWidth, and collapseWidth properties enables more precise control over the sidebar's appearance in various states.

Also applies to: 212-212


215-215: Good addition of global z-index control.

Adding a configurable z-index value allows for better stacking context management across the application layout.

packages/@core/preferences/src/config.ts (4)

12-17: Appropriate default values for content padding properties.

These sensible defaults (zero padding) ensure backward compatibility while providing flexibility for customization.


32-32: Good default z-index value.

The default value of 200 for z-index is appropriate for most UI layering scenarios.


53-53: Appropriate height defaults for footer and header.

The default height values (32px for footer, 50px for header) follow common UI practices and provide reasonable starting points.

Also applies to: 57-57


84-84: Good default width values for sidebar states.

The default width values for various sidebar states (collapseWidth: 60, extraCollapsedWidth: 60, mixedWidth: 80) provide reasonable dimensions for collapsed and mixed navigation modes.

Also applies to: 88-88, 91-91

packages/@core/preferences/src/types.ts (4)

36-47: Well-documented content dimension properties.

The type definitions include clear JSDoc comments explaining the purpose of each content dimension property, making it easier for developers to understand their usage.


78-79: Good z-index type definition.

The z-index property is properly typed as a number with a descriptive comment.


117-118: Appropriate height properties for footer and header.

The height properties for footer and header components are properly defined with clear comments.

Also applies to: 124-125


159-160: Well-defined sidebar width properties.

The sidebar width properties (collapseWidth, extraCollapsedWidth, mixedWidth) are properly defined with descriptive comments explaining their purpose.

Also applies to: 167-168, 173-174

docs/src/en/guide/essentials/settings.md (6)

189-194: Documentation updated with content padding properties.

The English documentation properly reflects the new content padding properties with their default values.


209-209: z-index documentation added.

The z-index property is properly documented with its default value.


230-230: Footer height documentation added.

The footer height property is properly documented with its default value of 32.


234-234: Header height documentation added.

The header height property is properly documented with its default value of 50.


260-260: Sidebar width properties documented.

The sidebar width properties (collapseWidth, extraCollapsedWidth, mixedWidth) are properly documented with their default values.

Also applies to: 264-264, 267-267


334-345: Type definitions properly documented in English.

The English documentation for the type definitions has been updated to include all the new properties with clear and consistent descriptions.

Also applies to: 414-415, 421-422, 455-456, 463-464, 469-470

docs/src/guide/essentials/settings.md (1)

334-344:

✅ Verification successful

Ensure TypeScript interface definitions align with default values
The newly added interface properties for padding, dimensions, and z-index must match the defaults in your configuration. Verify that packages/@core/preferences/src/types.ts reflects the same defaults as packages/@core/preferences/src/config.ts.

Use the following commands to inspect the interface definitions:

Also applies to: 375-376, 415-416, 421-422, 457-457, 465-465, 471-471


🏁 Script executed:

#!/bin/bash
# Inspect AppPreferences interface
rg -n "interface AppPreferences" -A20 packages/@core/preferences/src/types.ts
# Inspect FooterPreferences interface
rg -n "interface FooterPreferences" -A5 packages/@core/preferences/src/types.ts
# Inspect HeaderPreferences interface
rg -n "interface HeaderPreferences" -A5 packages/@core/preferences/src/types.ts
# Inspect SidebarPreferences interface
rg -n "interface SidebarPreferences" -A10 packages/@core/preferences/src/types.ts

Length of output: 1485


🏁 Script executed:

#!/bin/bash
# Verify default values for contentCompactWidth and padding in config.ts
rg -n "contentCompactWidth" -A3 packages/@core/preferences/src/config.ts
rg -n "contentPadding" -A6 packages/@core/preferences/src/config.ts

Length of output: 642


🏁 Script executed:

#!/bin/bash
# Verify z-index default values in config.ts
rg -n "zIndex" -A5 packages/@core/preferences/src/config.ts
# Inspect z-index properties in types.ts
rg -n "zIndex" -A5 packages/@core/preferences/src/types.ts

Length of output: 346


No discrepancies in TypeScript interfaces vs. defaults
All of the newly added properties in packages/@core/preferences/src/types.ts
• contentCompactWidth
• contentPadding
• contentPaddingBottom
• contentPaddingLeft
• contentPaddingRight
• contentPaddingTop
• zIndex

are declared as number, which matches the default numeric values in packages/@core/preferences/src/config.ts (e.g., contentCompactWidth: 1200, all contentPadding*: 0, zIndex: 200). No further changes are needed here.

Comment on lines 188 to +193
contentCompactWidth: 1200,
contentPadding: 16,
contentPaddingBottom: 16,
contentPaddingLeft: 16,
contentPaddingRight: 16,
contentPaddingTop: 16,
contentPadding: 0,
contentPaddingBottom: 0,
contentPaddingLeft: 0,
contentPaddingRight: 0,
contentPaddingTop: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify default layout padding and dimensions in documentation
The default values for contentCompactWidth, contentPadding* (all sides), zIndex, footer/header height, and sidebar width properties (collapseWidth, extraCollapsedWidth, mixedWidth) have been updated in the docs. Please confirm these documented defaults accurately reflect the values defined in your actual configuration (packages/@core/preferences/src/config.ts).

Run the following script to cross-check the defaults in the source config:

Also applies to: 208-208, 229-229, 233-233, 259-259, 263-263, 266-266


🏁 Script executed:

#!/bin/bash
# Verify defaultPreferences values in source config
rg -n "defaultPreferences" -A10 packages/@core/preferences/src/config.ts | \
  rg -E "contentCompactWidth|contentPadding|zIndex|height|collapseWidth|extraCollapsedWidth|mixedWidth"

Length of output: 573


🏁 Script executed:

#!/bin/bash
# Correctly verify defaultPreferences values in source config
rg -n "export const defaultPreferences" -A50 packages/@core/preferences/src/config.ts

Length of output: 87


🏁 Script executed:

#!/bin/bash
# Locate where contentCompactWidth is defined in the codebase
rg -n "contentCompactWidth" -n .

Length of output: 1245


🏁 Script executed:

#!/bin/bash
# Extract default preference values for layout dimensions and zIndex
rg -n -e "contentCompactWidth" \
      -e "contentPadding" \
      -e "contentPaddingBottom" \
      -e "contentPaddingLeft" \
      -e "contentPaddingRight" \
      -e "contentPaddingTop" \
      -e "zIndex" \
      -e "footerHeight" \
      -e "headerHeight" \
      -e "collapseWidth" \
      -e "extraCollapsedWidth" \
      -e "mixedWidth" -A2 packages/@core/preferences/src/config.ts

Length of output: 824


🏁 Script executed:

#!/bin/bash
# Search for headerHeight and footerHeight in defaultPreferences
rg -n -e "headerHeight" -e "footerHeight" packages/@core/preferences/src/config.ts

Length of output: 80


Align documented defaults with source configuration
The following defaults in docs/src/guide/essentials/settings.md must match the values in packages/@core/preferences/src/config.ts:

• contentCompactWidth: 1200
• contentPadding, contentPaddingBottom, contentPaddingLeft, contentPaddingRight, contentPaddingTop: 0
• zIndex: 200
• collapseWidth: 60
• extraCollapsedWidth: 60
• mixedWidth: 80

I could not find headerHeight or footerHeight in defaultPreferences – either remove those entries from the docs or add the corresponding properties in config.ts so they’re defined and kept in sync.

Locations to update:

  • docs/src/guide/essentials/settings.md: lines 188–193, 208, 229, 233, 259, 263, 266

Please update or reconcile these defaults.

🤖 Prompt for AI Agents
In docs/src/guide/essentials/settings.md at lines 188 to 193 and also at lines
208, 229, 233, 259, 263, and 266, update the documented default values for
contentCompactWidth, contentPadding (all sides), zIndex, collapseWidth,
extraCollapsedWidth, and mixedWidth to exactly match those defined in
packages/@core/preferences/src/config.ts: contentCompactWidth should be 1200,
all contentPadding values 0, zIndex 200, collapseWidth 60, extraCollapsedWidth
60, and mixedWidth 80. Additionally, remove headerHeight and footerHeight
entries from the docs since they are not defined in the source config to keep
documentation consistent with the actual configuration.

@wyc001122 wyc001122 closed this May 19, 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