Skip to content

feat(readme-modal): README 弹窗增大为近全屏尺寸 - #431

Merged
AmintaCCCP merged 1 commit into
mainfrom
feat/readme-modal-near-fullscreen
Oct 5, 2026
Merged

AmintaCCCP merged 1 commit into
mainfrom
feat/readme-modal-near-fullscreen

Conversation

@AmintaCCCP

@AmintaCCCP AmintaCCCP commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

变更内容

将点击仓库卡片打开的 README 弹窗增大为近全屏尺寸,与生成仓库信息卡插件弹窗(PluginPageModal)的尺寸保持一致。

之前

  • max-w-[1130px] + 内层 max-h-[90vh]

之后

  • w-[calc(100vw_-_2rem)] / h-[calc(100vh_-_2rem)](与 PluginPageModal 完全相同的尺寸四元组),四周各留 1rem 边距,几乎覆盖整个页面

具体修改

src/components/ReadmeModal.tsx

  • DialogContent:宽度改为 calc(100vw - 2rem)(去掉 max-w-[1130px]),高度改为 calc(100vh - 2rem);grid 改为 flex flex-col(对齐 Modal 的 scrollable 布局模式)
  • 内层容器:max-h-[90vh] 改为 flex-1 min-h-0,由父级固定高度驱动填充,头部 / TOC 侧栏 / 滚动内容区 / 返回顶部按钮 / 阅读进度条的布局关系不变

src/components/RepositoryCard.tsx

  • README 懒加载占位弹窗(Loading fallback)同步为相同尺寸,避免懒 chunk 加载完成、真实弹窗挂载时出现尺寸跳变

验证

  • eslint 通过(仅改动文件)
  • tsc -b --noEmit 通过
  • vitest run 全量通过:146 个测试文件 / 1687 个用例
  • 代码审计(覆盖 Tailwind 类覆盖合并、flex 布局健全性、懒加载占位一致性、全部使用方兼容性、移动端 100vw 滚动条风险、无障碍):无 P0/P1 问题,结论 SHIP
    • 100vw 的滚动条宽度风险已被 Radix Dialog(react-remove-scroll)打开时移除页面滚动条所抵消,与 PluginPageModal 行为一致
    • 其余 P2 备注均为与参考实现刻意保持一致或改动前即存在的既有情况

其他使用方

ReadmeModal 的全部使用方(RepositoryCard、SubscriptionRepoCard、BatchStarImportDialog)仅传入 props,不依赖旧尺寸;统一增大后各入口表现一致。

Summary by CodeRabbit

  • 界面优化
    • README 阅读弹窗及加载占位弹窗调整为接近全屏的尺寸,内容区域填满可用高度。

将点击仓库卡片的 README 弹窗从 max-w-[1130px]/max-h-[90vh] 改为
与生成仓库信息卡插件弹窗(PluginPageModal)一致的近全屏尺寸:
w/h 均为 calc(100vh|100vw - 2rem)。DialogContent 由 grid 改为
flex-col,内层容器用 flex-1 填满;RepositoryCard 的懒加载占位
弹窗同步同尺寸,避免弹窗真实加载时出现尺寸跳变。
@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Oct 5, 2026
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f708b20c-9170-40a8-8a42-2831bf1e2578
📥 Commits

Reviewing files that changed from the base of the PR and between 22b9a28 and 33dba3d.

📒 Files selected for processing (2)
  • src/components/ReadmeModal.tsx
  • src/components/RepositoryCard.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

README 展示弹窗和加载占位弹窗改为接近视口大小的布局。两个弹窗的内部容器均调整为填满可用高度。

Changes

README 弹窗布局

层 / 文件 摘要
调整弹窗尺寸与内容区布局
src/components/ReadmeModal.tsx, src/components/RepositoryCard.tsx
README 展示弹窗移除原有最大宽度和内容高度限制,改为宽高按视口尺寸减去 2rem 设置。加载占位弹窗改为接近视口大小,并让内容区填满可用高度。关闭焦点处理保持不变。

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Feature

Suggested reviewers: khk-nl

Merge Risk: ⚪ Minimal · up to 33dba

Both README dialogs use the intended near-viewport layout, and long README content remains scrollable. No concrete merge-blocking issue is established.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了主要变更:将 README 弹窗调整为近全屏尺寸。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Comment @coderabbitai help to get the list of available commands.

@AmintaCCCP
AmintaCCCP merged commit 6cdb440 into main Oct 5, 2026
10 checks passed
@AmintaCCCP
AmintaCCCP deleted the feat/readme-modal-near-fullscreen branch October 5, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant