Repository navigation
fix: adjust folder popup width for small app counts - #1854
Open
18202781743 wants to merge 1 commit into
Open
18202781743 wants to merge 1 commit into
18202781743 wants to merge 1 commit into
Conversation
1. Root cause: columns property always returned 4 for itemCount <= 8, and minimumWidth was hardcoded to 420, so folders with fewer than 4 apps still rendered at full 420px width 2. Fix: columns now uses actual item count when itemCount < 4, and minimumWidth is set to 0 to let width follow real content size 3. Impact: folders with 1-3 apps show compact width (120/216/312px instead of 420px); folders with 4+ apps are unchanged Log: fix folder popup showing oversized panel for small app groups Influence: 1. Test folder popup with 1, 2, 3 apps and verify panel width matches content 2. Test folder popup with 4+ apps and verify no regression 3. Verify popup positioning remains within screen work area fix: 修复应用组面板在应用数量较少时宽度过大的问题 1. 根因:columns 属性在 itemCount <= 8 时始终取 4 列,且 minimumWidth 硬编码为 420,导致应用数少于 4 个时面板仍为 420px 最大宽度 2. 方案:columns 在 itemCount < 4 时按实际应用数取列数, minimumWidth 设为 0 使宽度跟随实际内容尺寸 3. 影响:1-3 个应用的面板宽度分别变为 120/216/312px(原为 420px);4 个及以上应用的行为不变 Log: 修复应用组面板在应用数量较少时宽度过大的问题 Influence: 1. 测试 1、2、3 个应用时面板宽度是否与内容匹配 2. 测试 4 个及以上应用时面板无回归 3. 验证面板定位仍在屏幕工作区内 PMS: BUG-384231
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
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.
fix: adjust folder popup width for small app counts
Root Cause
In
panels/dock/taskmanager/package/FolderPopup.qml, thecolumnsproperty always returned 4 whenitemCount <= 8, andminimumWidthwas hardcoded to 420px. For folders with fewer than 4 apps (e.g. 2 apps), the grid used 4 columns and the minimum width forced the panel to 420px — the maximum size — instead of the actual content width (216px for 2 apps).Evidence: Python math reproduction (
repro/before.log) confirmed: foritemCount=2, current width=420px vs expected width=216px. Flip experiment (repro/contrast.log) confirmed that fixing bothcolumnsandminimumWidtheliminates the anomaly, and reverting restores it.Fix
columns: whenitemCount < 4, useMath.max(1, itemCount)so the column count matches the actual number of apps; foritemCount >= 4, behavior is unchanged (4for ≤8,5for >8).minimumWidth: changed from420to0so the panel width follows the actual content size instead of being forced to a minimum.Change Safety
Risk level: Low (see
change-safety.md)columnsandminimumWidthare internal toFolderPopup.qml, referenced only byrows,Grid.columns,ItemDelegate.width, and thewidthbinding — all adapt automatically.hasProviderContent=truepath usescontentLoader.item.implicitWidthand is unaffected.Business Impact
itemCount >= 4) produces identical results.Verification Suggestions
fix: 修复应用组面板在应用数量较少时宽度过大的问题
根因
panels/dock/taskmanager/package/FolderPopup.qml中columns属性在itemCount <= 8时始终取 4 列,且minimumWidth硬编码为 420px。当应用组内应用数少于 4 个(如 2 个)时,网格仍使用 4 列,最小宽度强制面板为 420px(最大尺寸),而非实际内容宽度(2 个应用应为 216px)。证据:Python 数学复现(
repro/before.log)确认:itemCount=2时当前宽度=420px,期望宽度=216px。翻转实验(repro/contrast.log)确认同时修改columns和minimumWidth后异常消失,恢复后异常复现。修复方案
columns:itemCount < 4时取Math.max(1, itemCount),列数与实际应用数一致;itemCount >= 4时行为不变(≤8 取 4 列,>8 取 5 列)。minimumWidth:从420改为0,使面板宽度跟随实际内容尺寸。改动安全评估
风险等级:低(见
change-safety.md)columns和minimumWidth仅在FolderPopup.qml内部使用,被rows、Grid.columns、ItemDelegate.width和width绑定引用,改动后自动适配。hasProviderContent=true路径走contentLoader.item.implicitWidth,不受影响。业务影响范围
itemCount >= 4)结果完全一致。验证建议
PMS: BUG-384231