Skip to content

fix(@vben/common-ui): resolve #6698 - #6700

Merged
jinmao88 merged 4 commits into
vbenjs:mainfrom
qianYuanJ:fix-#6698
Sep 2, 2025
Merged

jinmao88 merged 4 commits into
vbenjs:mainfrom
qianYuanJ:fix-#6698

Conversation

@qianYuanJ

@qianYuanJ qianYuanJ commented Aug 28, 2025 •

Copy link
Copy Markdown
Contributor

Description

before modification
image

after modification
image

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

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

  • Bug Fixes
    • Page content height now accounts for the footer as well as the header and offsets, preventing content from being obscured.
    • Layout converted to a vertical flex column so content reliably fills remaining space and spacing behaves consistently across viewports.
    • Footer rendered in normal document flow instead of absolute positioning, improving layout stability, scrolling behavior, and responsive resizing.

@changeset-bot

changeset-bot Bot commented Aug 28, 2025 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 90fec81

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.

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

@coderabbitai

coderabbitai Bot commented Aug 28, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Content and layout updates to the Page component: content height calculation now subtracts header and footer heights plus offset; container classes switched to a vertical flex layout and inner content set to flex-1; footer removed from absolute positioning and rendered in normal document flow. No public API changes.

Changes

Cohort / File(s) Summary of edits
Page layout and sizing
packages/effects/common-ui/src/components/page/page.vue
- contentStyle height now subtracts footerHeight.value in addition to headerHeight.value and heightOffset.
- Root container class changed to relative flex min-h-full flex-col.
- Inner content div class changed to min-h-0 flex-1 p-4 to occupy remaining space.
- Footer removed from absolute positioning and rendered in normal document flow.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Page
  participant Header
  participant Footer
  participant Content

  User->>Page: Load Page
  Page->>Header: measure headerHeight
  Page->>Footer: measure footerHeight
  Page->>Content: compute height = var(--layout-content-height) - headerHeight - footerHeight - heightOffset
  Note over Content: Content uses min-h-0 and flex-1 to fill remaining vertical space
  Footer-->>Page: rendered in normal flow (not absolute)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • mynetfan
  • anncwb
  • jinmao88
  • vince292007

Poem

I hopped through classes, measured head and tail,
Subtracted both heights so content won't fail.
No absolute footing, we stretch and we flow,
Flex-column snugβ€”see the layout now grow.
πŸ‡βœ¨


πŸ“œ Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ’‘ Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between c1c121b and 90fec81.

πŸ“’ Files selected for processing (1)
  • packages/effects/common-ui/src/components/page/page.vue (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/effects/common-ui/src/components/page/page.vue
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Lint (windows-latest)
  • GitHub Check: Lint (ubuntu-latest)
  • GitHub Check: Check (windows-latest)
  • GitHub Check: Check (ubuntu-latest)
  • GitHub Check: Test (windows-latest)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: post-update (windows-latest)
  • GitHub Check: post-update (ubuntu-latest)
✨ Finishing Touches
πŸ§ͺ Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit 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:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/effects/common-ui/src/components/page/page.vue (2)

25-33: Guard against negative heights when offsets exceed container.
Wrap the calc with CSS max() to avoid collapsing to a negative height in edge cases (small viewports, large header/footer, big heightOffset).

-      height: `calc(var(${CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT}) - ${headerHeight.value}px - ${footerHeight.value}px - ${typeof heightOffset === 'number' ? `${heightOffset}px` : heightOffset})`,
+      height: `max(0px, calc(var(${CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT}) - ${headerHeight.value}px - ${footerHeight.value}px - ${typeof heightOffset === 'number' ? `${heightOffset}px` : heightOffset}))`,

95-100: Remove no-op positioning classes and fix alignment utility.
After dropping absolute positioning, bottom-0/left-0/right-0 do nothing. Also verify β€œalign-center” (Tailwind uses items-center).

-          'bg-card align-center bottom-0 left-0 right-0 flex px-6 py-4',
+          'bg-card flex items-center px-6 py-4',

Optionally add a top border for parity with the header:

-          'bg-card flex items-center px-6 py-4',
+          'bg-card flex items-center border-t border-border px-6 py-4',
πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ’‘ Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between b0d7b17 and 35bd6f5.

πŸ“’ Files selected for processing (1)
  • packages/effects/common-ui/src/components/page/page.vue (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Check (windows-latest)
  • GitHub Check: Lint (ubuntu-latest)
  • GitHub Check: Check (ubuntu-latest)
  • GitHub Check: Lint (windows-latest)
  • GitHub Check: Test (windows-latest)
  • GitHub Check: post-update (windows-latest)
  • GitHub Check: post-update (ubuntu-latest)
πŸ”‡ Additional comments (1)
packages/effects/common-ui/src/components/page/page.vue (1)

28-28: LGTM: subtracting footerHeight fixes overflow with in-flow footer.
This aligns content height with header+footer presence.

@qianYuanJ

Copy link
Copy Markdown
Contributor Author

deal with another situation
image
image

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/effects/common-ui/src/components/page/page.vue (1)

25-33: Make header/footer height updates reactive
contentStyle (lines 25–33) uses headerHeight.value and footerHeight.value, but calcContentHeight() is only called once onMounted (line 47), so element or viewport resizes won’t recalc layout, causing stale scroll areas. Add a ResizeObserver on headerRef/footerRef (and optional window.resize listener) to update those refs on size changes, and disconnect/cleanup in onUnmounted.

πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ’‘ Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 35bd6f5 and 9630682.

πŸ“’ Files selected for processing (1)
  • packages/effects/common-ui/src/components/page/page.vue (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Test (windows-latest)
  • GitHub Check: Check (windows-latest)
  • GitHub Check: Check (ubuntu-latest)
  • GitHub Check: post-update (windows-latest)
  • GitHub Check: post-update (ubuntu-latest)
πŸ”‡ Additional comments (1)
packages/effects/common-ui/src/components/page/page.vue (1)

53-53: Verify Flex-Column Footer Impact
Flex-column switch can break pages expecting a fixed/absolute footer. I ran a search for <Page> consumers using a footer slot but found noneβ€”please manually verify that no pages rely on the previous absolute-positioned footer. If any do, preserve legacy behavior by adding a footerFixed?: boolean prop.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
packages/effects/common-ui/src/components/page/page.vue (1)

89-89: LGTM and thanks for adopting min-h-0.

Replacing h-full with min-h-0 on the flex child prevents double scroll/overflow traps.

🧹 Nitpick comments (1)
packages/effects/common-ui/src/components/page/page.vue (1)

28-30: Rely on flex; drop JS height calc to avoid stale measurements and overflow flicker.

With the new flex column layout and footer in normal flow, explicit height math is unnecessary and brittle on resize/content changes. Let flex + min-h-0 handle it.

Apply:

-      height: `calc(var(${CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT}) - ${headerHeight.value}px - ${footerHeight.value}px - ${typeof heightOffset === 'number' ? `${heightOffset}px` : heightOffset})`,
-      overflowY: shouldAutoHeight.value ? 'auto' : 'unset',
+      overflowY: 'auto',

If keeping JS sizing, consider observing header/footer with ResizeObserver to react to dynamic height changes.

πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ’‘ Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 9630682 and c1c121b.

πŸ“’ Files selected for processing (1)
  • packages/effects/common-ui/src/components/page/page.vue (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Check (windows-latest)
  • GitHub Check: Check (ubuntu-latest)
  • GitHub Check: Lint (ubuntu-latest)
  • GitHub Check: post-update (windows-latest)
  • GitHub Check: Test (windows-latest)
  • GitHub Check: Lint (windows-latest)
  • GitHub Check: post-update (ubuntu-latest)
πŸ”‡ Additional comments (2)
packages/effects/common-ui/src/components/page/page.vue (2)

53-53: LGTM: root switched to flex column.

This aligns structure with the scrolling model change.


95-95: Remove invalid class; center with items/justify utilities.

align-center isn’t a standard Uno/Tailwind class. Use items-center (and optionally justify-center) instead.

[ suggest_nitpick ]
[ duplicate_comment ]
Apply:

-      :class="cn('bg-card align-center flex px-6 py-4', footerClass)"
+      :class="cn('bg-card flex items-center px-6 py-4', footerClass)"

@jinmao88
jinmao88 merged commit 6a85b3a into vbenjs:main Sep 2, 2025
dtera pushed a commit to dtera/vue-admin that referenced this pull request Sep 5, 2025
* fix(@vben/common-ui): resolve vbenjs#6698

* fix(@vben/common-ui): resolve vbenjs#6698

* fix(@vben/common-ui): resolve conversation

* fix(@vben/common-ui): resolve vbenjs#6698
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants