Files
2026-09-08 11:40:15 +08:00

6.2 KiB
Raw Permalink Blame History

医生工作站 UI 最终离屏回归

  • 验收日期:2026-08-10
  • 环境:Windows 11、Python 3.12.12、PySide6 6.11.1
  • 目标尺寸:1280 × 800
  • 最小 Shell 尺寸:1024 × 640
  • 最终结论:PASS

1. 结论摘要

最新原始源码已通过完整离屏回归。验收在全新 Python 进程中执行,没有加载任何方法别名、monkey patch 或兼容垫片,并明确断言 BusyOverlay 不存在临时 set_text 属性。

LoginWindow.submit() 使用空账号和密码触发 Demo 默认凭据,真实执行 DemoDoctorRepository.login()get_current_user(),随后由 ApplicationController 创建 ShellWindow。登录成功后 loading 正常释放、密码被清空,五个授权页面均能异步加载。

问诊列表到 Controller 再到 DemoVideoDialog 的信号链路、性别文本、服务器设置和 1024 × 640 最小 Shell 均通过。上一轮发现的四个问题现已全部关闭。

2. 验收方法

  1. 使用 QT_QPA_PLATFORM=offscreen 创建真实 QApplication
  2. 创建原始 LoginWindow,保持 Demo 模式并将账号密码留空,调用真实 submit()
  3. 等待 login_succeeded 和 Controller 创建 Shell,核对认证 Session、用户、repository、loading 与密码清理状态。
  4. 依次进入接诊台、我的处方库、已开处方、我的患者、问诊列表,等待后台 Worker 返回数据和详情。
  5. 在问诊列表点击“发起视频问诊”,验证 ConsultationsPage → ShellWindow.video_requested → ApplicationController._request_video → DemoVideoDialog 完整链路。
  6. 将 Shell 精确调整为 1024 × 640,检查接诊主要按钮的窗口坐标和 splitter 两侧可用宽度。
  7. 关闭 Demo 后展开服务器设置,保存 HTTPS 地址与 45 秒超时,验证设置存储和两个配置变更信号。
  8. 使用 QWidget.grab() 覆盖必要截图并逐张目检。

Qt offscreen 平台在本机不提供系统字体列表,因此验收进程临时用 QFontDatabase.addApplicationFont() 加载 C:\Windows\Fonts\msyh.ttc,使截图反映真实中文排版;未修改产品源码或打包配置。

3. 回归结果

范围 结果 验收证据
真实 Demo 登录 通过 空账号密码成功使用 Demo 默认凭据;发出 login_succeeded;Session 已认证;用户为“陈医生(演示)”;loading 释放且密码清空
服务器设置按钮 通过 Demo 模式下禁用;关闭 Demo 后可展开、保存、收起;地址规范化为 https://api.example.com/adminapi,超时为 45 秒
Shell / 权限导航 通过 Controller 创建接诊台、我的处方库、已开处方、我的患者、问诊列表共 5 页
接诊台 通过 待接诊 2 条,详情异步加载;性别显示“女”;1280 × 800 与 1024 × 640 均稳定
我的处方库 通过 Demo 模板 2 条
已开处方 通过 Demo 处方 2 条;详情显示“赵明远 · 男 · 53岁”
我的患者 通过 Demo 患者 3 条,首条详情正常加载
问诊列表 通过 今日待接诊 1 条,视频按钮可用
问诊 → Controller → DemoVideoDialog 通过 payload 为 appointment_id=101diagnosis_id=501patient_id=301Controller 以 key 501 创建并回收窗口
Demo 视频窗口 通过 980 × 660 正常渲染;计时到 00:01;麦克风与摄像头均可切换为关闭
1024 × 640 最小 Shell 通过 “完成接诊”边界为 (883, 243, 84, 38),右边界 967、下边界 281,完整位于窗口内;splitter 宽度为 [322, 430]
1280 × 800 视觉 通过 五页、登录页、服务器设置和视频窗无重叠或横向裁切

离屏断言摘要:

runtime_adapter = false
login = authenticated / 陈医生(演示) / loading released / password cleared
server_url = https://api.example.com/adminapi
server_timeout = 45
page_rows = reception 2 / library 2 / prescriptions 2 / patients 3 / consultations 1
reception_gender = 女 · 46岁 · 患者编号 301
prescription_gender = 赵明远 · 男 · 53岁
video_ids = appointment 101 / diagnosis 501 / patient 301
video_dialog = key 501 / duration 00:01 / mic off / camera off
compact_shell = 1024 × 640 / complete_button right 967 bottom 281
pytest = 69 passed

4. 问题关闭情况

问题 状态 本轮证据
F-01 问诊列表视频 ID 错置 已关闭 实际点击后得到 101 / 501 / 301,并由 Controller 创建 DemoVideoDialog
F-02 紧凑尺寸接诊详情横向裁切 已关闭 Shell 最小尺寸为 1024 × 640;该尺寸下两侧 splitter 有效,“完成接诊”完整可见
F-03 性别显示内部数值 已关闭 接诊显示“女”,处方详情显示“男”
F-04 Demo 登录 loading 调用不存在的方法 已关闭 LoginWindow 使用 BusyOverlay.set_message();无垫片真实登录成功进入 Shell

5. 截图索引

  1. 登录页 1280 × 800
  2. 接诊台 1280 × 800
  3. 我的处方库 1280 × 800
  4. 已开处方 1280 × 800
  5. 我的患者 1280 × 800
  6. 问诊列表 1280 × 800
  7. Demo 视频窗口 980 × 660
  8. 最小 Shell 1024 × 640
  9. 问诊视频链路成功页 1280 × 800
  10. 服务器设置 1280 × 800

旧的 08_shell_compact_900x600.png09_consultations_video_error_1280x800.png 是历史问题证据,不属于本轮最终截图索引。

6. 自动化测试记录

uv run --offline pytest
.....................................................................    [100%]
69 passed in 0.65s

本轮验收没有修改 src/ 下任何源文件;仅覆盖本报告和 artifacts/ui_acceptance/ 下的 PNG 截图。