docs(ai-outfit): record left-column clipping bug + analysis (§10.1)
Left column content is clipped on the right (looks covered by the center). Measured offscreen: the left QScrollArea has h-scroll AlwaysOff while its inner content demands 829px min width vs a ~428px viewport. The driver is the 样本行 QComboBox (minimumSizeHint ~743px from its long '第N行·货号·标题' item), which inflates the preview group. Documented root cause + fix direction (constrain combo size policy; left scroll AsNeeded). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -138,6 +138,24 @@ Excel 行 → `OutfitTask` 列表的转换由 `excel_service` 完成;核心只
|
||||
|
||||
> 页签内容切换:当前页签栏不切换内容面板(见 `docs/07` §4.2)。启用 AI 穿搭需要为页签接一个 `QStackedWidget`(「1 添加印花」=现有工作区,「2 AI 穿搭」=本面板);这部分在实现阶段一并补。
|
||||
|
||||
### 10.1 已知问题:左栏内容被中间面板裁掉(下拉框撑宽)
|
||||
|
||||
**现象**:「2 AI 穿搭」左栏组件右侧显示不完整,像被中间面板遮挡了一部分。
|
||||
|
||||
**定位(离屏实测 1280×720)**:
|
||||
|
||||
- 左栏是 `QScrollArea`(`ai_outfit_panel.py` `_build_left`),`widgetResizable(True)` 且**横向滚动条 `AlwaysOff`**。其内容的**最小宽度高达 829px**,而视口仅 ~428px;既不能再缩、又没有横向滚动条,于是内容按 829px 摆放、超出 ~428px 的右侧被裁掉,看起来就是"被中间盖住"。
|
||||
- 829px 由**单个控件**撑出:**「样本行」`QComboBox`** 的 `minimumSizeHint ≈ 743px`,因为它当前项是长字符串「第 N 行 · 货号 · 标题」。这把「最终提示词预览」分组撑到 ~805px 最小宽,主导了整列。**「AI 模型」下拉**有同样隐患(选到长模型名时一样会撑宽)。
|
||||
- 纵向正常(内容 666 vs 视口 664)——纯横向裁切,与"占位太多"无关。
|
||||
|
||||
**根因**:`QComboBox` 默认会让 `minimumSizeHint` 随当前/最长项文本增长;长文本下拉框把列撑宽,而"无横向滚动"的滚动区只能裁切。
|
||||
|
||||
**修复方向**:
|
||||
|
||||
- 让两个下拉框不再决定列宽:`setSizeAdjustPolicy(AdjustToMinimumContentsLengthWithIcon)` + `setMinimumContentsLength(6)` + `setSizePolicy(Ignored, Preferred)`,长项改为省略号(elide)而非撑宽。
|
||||
- 兜底:左栏滚动区横向策略由 `AlwaysOff` 改 `AsNeeded`,将来再有宽控件就滚动而非裁切。
|
||||
- 可选:`_build_ui` 的 `setSizes([430,760,300])`(和=1490)大于默认窗口 1280,首屏即被压缩;改成和≤窗口的一组(如 `[400,600,300]`),非根因。
|
||||
|
||||
## 11. 配置与数据位置
|
||||
|
||||
遵循 cmbot「配置集中、放数据目录、凭据不入库」约定:
|
||||
|
||||
Reference in New Issue
Block a user