-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Conversation
|
WalkthroughThis 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
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit 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. Note ⚡️ Faster reviews with cachingCodeRabbit 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 ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
⛔ 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
, andcollapseWidth
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 thatpackages/@core/preferences/src/types.ts
reflects the same defaults aspackages/@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.tsLength 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.tsLength 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.tsLength of output: 346
No discrepancies in TypeScript interfaces vs. defaults
All of the newly added properties inpackages/@core/preferences/src/types.ts
—
• contentCompactWidth
• contentPadding
• contentPaddingBottom
• contentPaddingLeft
• contentPaddingRight
• contentPaddingTop
• zIndexare declared as
number
, which matches the default numeric values inpackages/@core/preferences/src/config.ts
(e.g.,contentCompactWidth: 1200
, allcontentPadding*: 0
,zIndex: 200
). No further changes are needed here.
contentCompactWidth: 1200, | ||
contentPadding: 16, | ||
contentPaddingBottom: 16, | ||
contentPaddingLeft: 16, | ||
contentPaddingRight: 16, | ||
contentPaddingTop: 16, | ||
contentPadding: 0, | ||
contentPaddingBottom: 0, | ||
contentPaddingLeft: 0, | ||
contentPaddingRight: 0, | ||
contentPaddingTop: 0, |
There was a problem hiding this comment.
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.
Description
I am very sorry, I accidentally set the padding incorrectly to 16
Type of change
Please delete options that are not relevant.
Checklist
pnpm run docs:dev
command.pnpm test
.feat:
,fix:
,perf:
,docs:
, orchore:
.Summary by CodeRabbit
New Features
Documentation