diff --git a/AGENTS.md b/AGENTS.md index 4ba1de2..2382d2e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,6 +9,18 @@ 继续遵守全局目标重述、品质自检及 UI 多方案先选后改规则。涉及 UI 新设计或大幅修改时,读取 `C:/Users/20143/.codex/skills/ui-design-choice-gate/SKILL.md`,先展示多个方案并等待明确选择;不能直接改正式界面。 +## UI 改动后必须运行最新项目供用户检查 + +- 每批正式 UI 改动完成、准备交付时,必须重新构建并运行最新项目,让用户直接检查效果;不得只修改源码、通过测试或展示独立原型后就宣布完成。适用于页面结构、菜单、文字、样式、图标、图片以及影响界面行为的 Rust/Wasm 或 JavaScript 改动。 +- 先使用 `. ./scripts/rust-env.ps1`,按现有流程依次执行 `cargo xtask web` 和 `cargo build --release --locked -p fpv-rid-registry --bin fpv-rid-registry-fullstack`。前端资源嵌入后端可执行文件,只构建前端或刷新旧程序不能证明改动生效;任一步失败即停止交付并处理问题。若 Windows 下目标 EXE 被当前实例占用,先核对进程身份、确认无活动任务并保留可恢复的旧程序,再安全停止该实例后构建;构建失败时恢复可用版本并明确其仍为旧界面。 +- 启动前核对 `127.0.0.1:8787` 的监听进程、实际可执行文件与 `--data-root`。使用本次构建的最新 Release 程序,保留当前业务数据目录及原有档案、照片和设置;不得误启动旧的日期预览包,或以空白测试数据库冒充用户正在使用的项目。 +- 本项目的 UI HTTP 服务统一使用唯一端口 `127.0.0.1:8787`。重新运行时必须先核对并安全退出本项目旧实例,确认原端口已释放,再在同一端口启动最新版本;启动后核对监听进程,保持一个项目 UI 服务实例。发现本项目遗留的旧版或预览实例时,核实身份与活动状态后安全退出,不让它们常驻其他端口。 +- 不得因端口占用而自动换端口,也不得通过 `RID_TEST_PORT`、临时代理、备用端口或额外预览服务绕开旧实例。需要启动 UI HTTP 服务的验收测试同样遵守单端口要求,采用同端口串行验证,并在完成后恢复最新正式实例;现有多端口测试脚本不能直接作为例外运行。若原端口被其他程序占用或暂时无法安全释放,应说明阻碍,不误停其他程序、不擅自增加端口。 +- 本规则包含用户对必要本地构建、启动及安全重启本项目实例的持续授权,无需等待用户再次说“运行一下”。重启前检查正在保存、设备接收和地图下载等活动;不得强制打断活动任务、误停其他实例或迁移、重置、覆盖业务数据。 +- 启动后确认监听进程确为最新程序,并在浏览器打开实际运行地址及本次改动页面,核对界面、关键交互、菜单切换和控制台错误。提供可点击的页面链接,说明改动具体位于哪里;视觉变化提供本地截图或直接展示页面,不能仅以进程存在或编译成功代替界面验收。 +- 若原页面仍加载旧资源,应刷新并复核实际响应资源与构建产物一致。交付时简述改动位置、运行地址、实际运行版本的路径或进程标识及浏览器验证结果;构建、测试、实际运行和真实设备验证分别报告。 +- 遇到工具权限拒绝、端口占用、活动任务或其他实际阻碍时,不绕过限制;明确报告“最新界面尚未运行/验证”、具体原因与必要的用户操作,不得宣称已更新运行版本。独立设计原型仍遵守先选后改规则;纯规则、文档及与 UI 无关的修改不触发本节的重新运行要求。 + ## 工具、依赖与文件夹管理 - 统一管理根目录为 `D:/Rust_Contact/util`:`cargo/` 为 CARGO_HOME,`rustup/` 为 RUSTUP_HOME,`target/Rid_Drone_Receivev/` 为本项目构建目录,`tools/` 管理独立工具,`downloads/` 保留安装包;新增原生 SDK 按 `native////` 存放。 diff --git a/crates/web-ui/public/map-settings.css b/crates/web-ui/public/map-settings.css index 4429f3b..0587b0e 100644 --- a/crates/web-ui/public/map-settings.css +++ b/crates/web-ui/public/map-settings.css @@ -1,4 +1,6 @@ -.map-settings-layout{height:100%;min-height:0!important;padding:18px;display:flex;color:var(--work-text)}.map-settings-stage{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.map-settings-head{display:flex;align-items:center;gap:28px;padding:16px 20px;border-bottom:1px solid var(--work-line);flex:none}.map-settings-head h2{font-size:18px;margin:0}.map-settings-head p{font-size:11px;color:var(--work-muted);margin:5px 0 0}.map-settings-nav{display:flex;gap:5px;align-items:center}.map-settings-nav button,.map-settings-nav span{padding:9px 13px;border-radius:7px;font-size:12px}.map-settings-nav button{background:transparent;border-color:transparent}.map-settings-nav span{background:var(--work-input);border:1px solid var(--work-line)}.map-local-note{margin-left:auto;font-size:11px;color:var(--work-muted)}.map-settings-body{display:grid;grid-template-columns:minmax(0,1fr) 380px;flex:1;min-height:0}.map-settings-preview{position:relative;min-width:0;min-height:0;background:#061221;overflow:hidden}#settings-map{position:absolute;inset:0}.map-settings-hint{position:absolute;left:16px;right:16px;bottom:94px;max-width:520px;background:var(--glass-solid);border:1px solid var(--work-line);border-radius:7px;padding:10px 12px;font-size:11px;line-height:1.7;pointer-events:none;z-index:3}.map-settings-panel{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--glass-solid);border-left:1px solid var(--work-line)}.map-settings-tabs{display:flex;gap:8px;padding:16px 18px 12px;flex:none}.map-settings-tabs button{flex:1;background:transparent;border-color:transparent;padding:10px 8px;border-radius:7px;font-size:13px}.map-settings-tabs [aria-selected=true]{background:#8bbdff1c;border-color:#8bbdff55;color:var(--work-text)}.map-network-note{font-size:11px;line-height:1.7;color:var(--work-muted);margin:0 18px 10px;padding:8px 10px;border:1px solid var(--work-line);border-radius:6px;flex:none;overflow-wrap:anywhere}.map-network-note.warning{color:#ffd08a;border-color:#ffd08a55}.map-task-panel{display:flex;flex:1;flex-direction:column;min-height:0}.map-settings-layout [hidden]{display:none!important}.map-settings-scroll{flex:1;min-height:0;overflow:auto;padding:12px 20px 18px;scrollbar-width:thin;scroll-padding:12px}.map-section-title{font-size:15px;margin:0 0 8px}.map-settings-label{display:block;font-size:12px;color:var(--work-muted);min-width:0}.map-settings-scroll :is(input:not([type=checkbox]),select){display:block;width:100%;min-width:0;height:39px;margin-top:7px;padding:8px 10px;border:1px solid var(--work-line);border-radius:7px;background:var(--work-input);color:var(--work-text);font:inherit;font-size:12px;box-shadow:none}.map-settings-fields{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin:14px 0}.map-settings-caption{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--work-line);padding-top:16px;margin-top:20px;font-size:13px}.map-settings-layout button{font-size:12px;border-radius:7px;padding:9px 12px}.map-settings-caption button{padding:6px 10px}.map-current{margin-top:14px}.map-location-zoom{display:grid;grid-template-columns:minmax(80px,1fr) auto;gap:12px;align-items:end}.map-location-zoom .map-current{margin:0;height:39px}.map-settings-layout .map-footer-actions .primary{width:auto;height:38px}.map-settings-small{font-size:11px;color:var(--work-muted);line-height:1.8;margin:8px 0 16px}.map-panel-footer{display:block;flex:none;padding:12px 18px 16px;border-top:1px solid var(--work-line)}.map-footer-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}.map-footer-actions .primary{margin-left:auto}.map-settings-message{font-size:11px;line-height:1.8;color:#bdd9ff;overflow-wrap:anywhere}.map-settings-message.error{color:var(--mc-danger,#ffaaa4)}.map-reload{padding:6px 0!important;background:none!important;border:0!important;box-shadow:none!important;color:var(--work-muted)}.map-download-steps{display:flex;gap:6px;padding:0 18px 12px;flex:none}.map-download-steps button{display:flex;flex-direction:column;align-items:center;flex:1;min-width:0;padding:8px 4px;font-size:11px;line-height:1.6;background:transparent}.map-download-steps span{display:block;color:var(--work-muted);font-size:10px}.map-download-steps [aria-current=step]{border-color:#8bbdff88;background:#8bbdff1c}.map-range-summary{font-size:12px;line-height:1.9;color:var(--work-text);padding:12px;background:var(--work-input);border-radius:7px;overflow-wrap:anywhere;white-space:pre-line}.map-advanced{margin-top:18px;border-top:1px solid var(--work-line);padding-top:14px}.map-advanced summary{font-size:12px;color:var(--work-muted);cursor:pointer;line-height:1.8}.map-settings-actions{display:flex;gap:8px;margin:12px 0}.map-layer-choices{display:flex;flex-direction:column;gap:16px;font-size:12px;margin:24px 0}.map-layer-choices label{display:flex;align-items:center;gap:9px}.map-layer-choices input{width:16px;height:16px;box-shadow:none}#map-download-progress{display:block;width:100%;height:8px;margin:22px 0 14px;accent-color:#8bbdff}.map-settings-layout button:disabled{opacity:.45;cursor:not-allowed}.map-settings-layout :is(button,input,select,summary):focus-visible{outline:2px solid #8bbdff;outline-offset:3px}.map-download-selection{position:absolute;border:2px dashed #b3d5ff;background:#8bbdff26;pointer-events:none;z-index:2}.map-settings-layout .maplibregl-ctrl-group{background:var(--glass-solid);border:1px solid var(--work-line)}.map-settings-layout .maplibregl-ctrl-group button{border-radius:0;color:var(--work-text);border-color:var(--work-line);background:transparent;padding:0}.map-settings-layout .maplibregl-ctrl button .maplibregl-ctrl-icon{filter:invert(1)}.map-settings-layout .maplibregl-ctrl-attrib{font-size:9px;background:var(--glass-solid);color:var(--work-muted)}.map-settings-layout .maplibregl-ctrl-attrib a{color:var(--work-muted)}.map-settings-layout .maplibregl-ctrl-attrib-button{filter:invert(1)} +.map-settings-layout{height:100%;min-height:0!important;padding:18px;display:flex;color:var(--work-text)}.map-settings-stage{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.map-settings-head{display:flex;align-items:center;gap:28px;padding:16px 20px;border-bottom:1px solid var(--work-line);flex:none}.map-settings-head h2{font-size:18px;margin:0}.map-settings-head p{font-size:11px;color:var(--work-muted);margin:5px 0 0}.map-settings-nav{display:flex;gap:5px;align-items:center}.map-settings-nav button,.map-settings-nav span{padding:9px 13px;border-radius:7px;font-size:12px}.map-settings-nav button{background:transparent;border-color:transparent}.map-settings-nav span{background:var(--work-input);border:1px solid var(--work-line)}.map-local-note{margin-left:auto;font-size:11px;color:var(--work-muted)}.map-settings-body{display:grid;grid-template-columns:minmax(0,1fr) 380px;flex:1;min-height:0}.map-settings-preview{position:relative;min-width:0;min-height:0;background:#061221;overflow:hidden}#settings-map{position:absolute;inset:0}.map-settings-hint{position:absolute;left:16px;right:16px;bottom:94px;max-width:520px;background:var(--glass-solid);border:1px solid var(--work-line);border-radius:7px;padding:10px 12px;font-size:11px;line-height:1.7;pointer-events:none;z-index:3}.map-settings-panel{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--glass-solid);border-left:1px solid var(--work-line)}.map-settings-tabs{display:flex;gap:8px;padding:16px 18px 12px;flex:none}.map-settings-tabs button{flex:1;background:transparent;border-color:transparent;padding:10px 8px;border-radius:7px;font-size:13px}.map-settings-tabs [aria-selected=true]{background:#8bbdff1c;border-color:#8bbdff55;color:var(--work-text)}.map-network-note{font-size:11px;line-height:1.7;color:var(--work-muted);margin:0 18px 10px;padding:8px 10px;border:1px solid var(--work-line);border-radius:6px;flex:none;overflow-wrap:anywhere}.map-network-note.warning{color:#ffd08a;border-color:#ffd08a55}.map-task-panel{display:flex;flex:1;flex-direction:column;min-height:0}.map-settings-layout [hidden]{display:none!important}.map-settings-scroll{flex:1;min-height:0;overflow:auto;padding:12px 20px 18px;scrollbar-width:thin;scroll-padding:12px}.map-section-title{font-size:15px;margin:0 0 8px}.map-settings-label{display:block;font-size:12px;color:var(--work-muted);min-width:0}.map-settings-scroll :is(input:not([type=checkbox]),select){display:block;width:100%;min-width:0;height:39px;margin-top:7px;padding:8px 10px;border:1px solid var(--work-line);border-radius:7px;background:var(--work-input);color:var(--work-text);font:inherit;font-size:12px;box-shadow:none}.map-settings-fields{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin:14px 0}.map-settings-caption{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--work-line);padding-top:16px;margin-top:20px;font-size:13px}.map-settings-layout button{font-size:12px;border-radius:7px;padding:9px 12px}.map-settings-caption button{padding:6px 10px}.map-current{margin-top:14px}#map-location-panel .map-settings-scroll{padding-bottom:8px}#map-location-panel .map-settings-small{margin:4px 0 10px}#map-location-panel .map-settings-caption{margin-top:16px}.map-location-zoom{display:grid;grid-template-columns:minmax(80px,1fr) auto;gap:12px;align-items:end}.map-location-zoom .map-current{margin:0;height:39px}.map-settings-layout .map-footer-actions .primary{width:auto;height:38px}.map-settings-small{font-size:11px;color:var(--work-muted);line-height:1.8;margin:8px 0 16px}.map-panel-footer{display:block;flex:none;padding:12px 18px 16px;border-top:1px solid var(--work-line)}.map-footer-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}.map-footer-actions .primary{margin-left:auto}.map-settings-message{font-size:11px;line-height:1.8;color:#bdd9ff;overflow-wrap:anywhere}.map-settings-message.error{color:var(--mc-danger,#ffaaa4)}.map-reload{padding:6px 0!important;background:none!important;border:0!important;box-shadow:none!important;color:var(--work-muted)}.map-download-steps{display:flex;gap:6px;padding:0 18px 12px;flex:none}.map-download-steps button{display:flex;flex-direction:column;align-items:center;flex:1;min-width:0;padding:8px 4px;font-size:11px;line-height:1.6;background:transparent}.map-download-steps span{display:block;color:var(--work-muted);font-size:10px}.map-download-steps [aria-current=step]{border-color:#8bbdff88;background:#8bbdff1c}.map-range-summary{font-size:12px;line-height:1.9;color:var(--work-text);padding:12px;background:var(--work-input);border-radius:7px;overflow-wrap:anywhere;white-space:pre-line}.map-advanced{margin-top:18px;border-top:1px solid var(--work-line);padding-top:14px}.map-advanced summary{font-size:12px;color:var(--work-muted);cursor:pointer;line-height:1.8}.map-settings-actions{display:flex;gap:8px;margin:12px 0}.map-layer-choices{display:flex;flex-direction:column;gap:16px;font-size:12px;margin:24px 0}.map-layer-choices label{display:flex;align-items:center;gap:9px}.map-layer-choices input{width:16px;height:16px;box-shadow:none}#map-download-progress{display:block;width:100%;height:8px;margin:22px 0 14px;accent-color:#8bbdff}.map-settings-layout button:disabled{opacity:.45;cursor:not-allowed}.map-settings-layout :is(button,input,select,summary):focus-visible{outline:2px solid #8bbdff;outline-offset:3px}.map-download-selection{position:absolute;border:2px dashed #b3d5ff;background:#8bbdff26;pointer-events:none;z-index:2}.map-settings-layout .maplibregl-ctrl-group{background:var(--glass-solid);border:1px solid var(--work-line)}.map-settings-layout .maplibregl-ctrl-group button{border-radius:0;color:var(--work-text);border-color:var(--work-line);background:transparent;padding:0}.map-settings-layout .maplibregl-ctrl button .maplibregl-ctrl-icon{filter:invert(1)}.map-settings-layout .maplibregl-ctrl-attrib{font-size:9px;background:var(--glass-solid);color:var(--work-muted)}.map-settings-layout .maplibregl-ctrl-attrib a{color:var(--work-muted)}.map-settings-layout .maplibregl-ctrl-attrib-button{filter:invert(1)} @media(max-width:1100px){.map-settings-layout{padding:12px}.map-settings-body{grid-template-columns:minmax(0,1fr) 350px}.map-local-note{display:none}.map-settings-head{gap:16px}} @media(max-width:760px){.map-settings-layout{height:auto;min-height:100%!important;padding:10px}.map-settings-head{padding:14px;flex-wrap:wrap;gap:12px}.map-settings-nav{flex-wrap:wrap}.map-settings-body{display:flex;flex-direction:column}.map-settings-preview{height:300px;flex:none}.map-settings-panel{height:640px;border-left:0;border-top:1px solid var(--work-line)}.map-settings-hint{bottom:94px;font-size:10px}.map-settings-scroll{padding:12px 16px}.map-settings-tabs,.map-download-steps{padding-left:14px;padding-right:14px}.map-network-note{margin-left:14px;margin-right:14px}.map-footer-actions{gap:6px}.map-settings-layout button{padding:8px 10px}.map-footer-actions .primary{margin-left:auto}} @media(min-width:761px) and (max-height:650px){.map-settings-head{padding:10px 18px}.map-settings-head p,.map-local-note{display:none}.map-settings-tabs{padding-top:10px;padding-bottom:8px}.map-network-note{font-size:10px;padding:5px 8px}.map-panel-footer{padding:8px 16px}.map-download-steps{padding-bottom:8px}} + + diff --git a/crates/web-ui/public/workbench.css b/crates/web-ui/public/workbench.css index 2ace453..46dfefd 100644 --- a/crates/web-ui/public/workbench.css +++ b/crates/web-ui/public/workbench.css @@ -1,11 +1,11 @@ /* Approved A workbench: only home, registration and appearance use this layout. */ body[data-screen=home] .home-launcher.homescreen { - inset: 48px 0 0 68px !important; + inset: 48px 0 0 0 !important; margin: 0 !important; padding: 34px 28px; container: home-workbench / inline-size; } -body[data-screen=home][data-menu-hidden=true] .home-launcher.homescreen { left: 0 !important; } +body[data-screen=home] :is(.reference-rail, #toggle-menu) { display: none; } .home-space { width: 100%; max-width: 1170px; } .home-kicker { color: var(--work-muted); font-size: 11px; letter-spacing: .14em; margin-bottom: 10px; } .home-heading h1 { font-size: 27px; } @@ -188,7 +188,7 @@ body:is([data-screen=register], [data-screen=archives]) .registry-workspace #reg .setting-panel-head { padding: 0 16px; } } @media(max-width: 760px) { - body[data-screen=home] .home-launcher.homescreen { left: 56px !important; padding: 28px 20px; } + body[data-screen=home] .home-launcher.homescreen { padding: 28px 20px; } body[data-screen=home] .workspace-home-link > #workspace-brand { display: inline; font-size: 12px; } body[data-screen=home] #reference-title { display: none; } .home-heading h1 { font-size: 24px; } diff --git a/crates/web-ui/src/registry.html b/crates/web-ui/src/registry.html index 9272425..cba52b6 100644 --- a/crates/web-ui/src/registry.html +++ b/crates/web-ui/src/registry.html @@ -8,8 +8,8 @@

新建设备登记

填写设备信息,生成本机登记二维码

-

设备身份

仅模块 SN 必填

SN 需与上位机模块一致;相同 SN 再次保存将更新原档案。

-

登记编号

自动生成或手动填写

已有编号仅填写后 8 位数字。
留空时,保存后自动生成。

+

设备身份

仅模块 SN 必填

6–40 位英文字母、数字或半角连字符 -;请填写设备实际 SN,不支持中文名称。

SN 需与上位机模块一致;相同 SN 再次保存将更新原档案。

+

登记编号

自动生成或手动填写

已有编号仅填写后 8 位数字。
留空时,保存后自动生成。

设备照片

选填 · 最多 2 张

JPG、PNG、WebP · 每张不超过 5 MB · 仅保存在本机档案

保存时校验 SN 与编号

二维码与核验

等待完成登记

保存后自动生成二维码,供本地版上位机读取和核验。

  1. 填写模块 SN
  2. 保存登记并生成二维码
  3. 在本地版上位机核验