🤖 Fix: 修复在4K屏幕下显示出问题的情况 (Resolves #142)#143
Open
github-actions[bot] wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI: Resolves #142
This Pull Request was automatically generated by OpenCode to address Issue #142.
📝 AI Modification Summary & Conclusion:
4K Screen Display Fix - Implementation Summary
Problem
On 4K (3840x2160) and ultrawide (3440x1440, 2560x1080) displays, the plweb2 application exhibited the following issues:
wide), leaving only 4 items per row on a 4K screen. Each item would be ~960px wide, far too large for project cards.20px(primary) and16px(secondary), which can appear too small on high-resolution displays without scaling.Files Modified
1.
src/layout/useResponsive.tsCore responsive logic - Added ultrawide/4K breakpoint support:
ultrawide: 2560breakpoint to thebreakpointsobject. This threshold covers:getBlockItemsPerRow()to return 6 items per row for screens >= 2560px (up from 4)getFriendItemsPerRow()to return 8 items per row (up from 5)getFontSizeM()to return22pxfor ultrawide (up from 20px)getFontSizeS()to return18pxfor ultrawide (up from 16px)isUltrawidecomputed property and exported it2.
src/App.vueGlobal layout constraint for 4K screens:
@media (min-width: 2560px)CSS rule that:htmlbackground to a dark color (#2c2c2e) for letterboxing effect#apptomax-width: 1920pxwithmargin: 0 autofor centeringbox-shadowto visually distinguish the app container3.
src/layout/startPage.cssGrid container constraint for Home and BlackHole pages:
@media (min-width: 2560px)rule constraining.block-containertomax-width: 1800pxcentered4.
src/layout/BiLayout.cssBiLayout right panel constraint for Profile and ExperimentSummary pages:
@media (min-width: 2560px)rule constraining.right-bottom-containertomax-width: 960pxcentered5.
src/views/WorkList.vueWork list page constraint:
@media (min-width: 2560px)CSS rule constraining.list(fixed-position container) tomax-width: 1800pxcentered usingleft: 50%; transform: translateX(-50%)Technical Approach
Breakpoint-based responsive design: Extended the existing breakpoint system rather than adding device-specific "4K" checks. The threshold of 2560px was chosen because it covers both native ultrawide monitors and 4K displays with common DPI scaling settings (150%).
Progressive enhancement: All changes are additive - they only take effect at widths >= 2560px, with zero impact on existing screen sizes. The app behavior for standard desktop (1920px, 1440px) and mobile remains identical.
CSS max-width constraints: Applied centered max-width containers at three levels:
#appconstrained to1920px.block-containerconstrained to1800px.right-bottom-containerconstrained to960pxThis creates a layered constraint system that prevents any content area from exceeding comfortable reading widths on 4K displays.
Row count increase: By increasing grid columns from 4 to 6 (blocks) and 5 to 8 (friends), each item maintains reasonable dimensions on ultrawide screens instead of being stretched to enormous sizes.
Verification
vue-tsc --noEmit): No errorsvite build): Successful