test(ui): the minimal form joins the accepted design's reference states
This commit is contained in:
1 parent
69bf4c7b81
commit
efb2d376f4
5 files changed
+2373
-1085
No files matched your search
@@ -51,7 +51,7 @@ the shared controls. That was the wrong instruction for a visual design. The
|
||||
prototype's stylesheet and its page markup are the design. So:
|
||||
|
||||
1. **Start from the prototype's code.** Merge `origin/claude/room-next`
|
||||
(`9073256d`). Where it and your shell differ in what the living layout
|
||||
(now `2ac61f88`). Where it and your shell differ in what the living layout
|
||||
renders, the prototype wins: its grid, its dock, its type sizes, its
|
||||
selection, its couch, its tiles.
|
||||
2. **Keep your own work where the rendered result does not change**:
|
||||
@@ -63,13 +63,31 @@ prototype's stylesheet and its page markup are the design. So:
|
||||
`drive.mjs` renders the states in a Chrome that listens for remote
|
||||
debugging and records each element's edges, `align.mjs` checks the grid,
|
||||
and `compare.mjs` compares a run with `reference-edges.json`, which is
|
||||
the prototype at `9073256d`. Its header says how to run it. The shell is
|
||||
the prototype at `2ac61f88`. Its header says how to run it. The shell is
|
||||
accepted when every state matches within its tolerance and I have looked
|
||||
at the captures. Where your component work must change a recorded edge,
|
||||
say which and why, and I will change the reference if it is right.
|
||||
|
||||
The present layouts are untouched by this and stay as they are.
|
||||
|
||||
## Added since I wrote the above: the minimal form
|
||||
|
||||
The owner asked whether the new design has a minimal mode. It had none, so the
|
||||
prototype now has one behind the preview switch `minimal`
|
||||
(`origin/claude/room-next` `2ac61f88`): the room alone, with no rooms column
|
||||
and no dock. The top row is the room's, a waiting television holds the room
|
||||
when nobody shares, and my controls are a labelled bar on the couch's axis.
|
||||
The conversation opens beside the room on demand and the rooms open over it
|
||||
from the top row. It is the same design with the frame's column left out, so
|
||||
"full" and "minimal" become two forms of one layout and the present two modes
|
||||
have somewhere to go.
|
||||
|
||||
`reference-edges.json` now holds 99 states, the minimal form's nine among
|
||||
them, and the harness's checker and recorder are refreshed with it. Take the
|
||||
full form first; the minimal form reuses the bar a phone already has. Not in
|
||||
the prototype yet: the quick-start flow that creates a room and opens the
|
||||
picker, which the present minimal mode has.
|
||||
|
||||
## Several voice rooms: the proposal, revised
|
||||
|
||||
You are right about the gate, and about the one-room boundary. This version
|
||||
|
||||
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
|
||||
const all = JSON.parse(readFileSync(`${process.env.OUT_DIR ?? fileURLToPath(new URL("../../build/room-layout", import.meta.url))}/edges.json`, "utf8"));
|
||||
let failures = 0;
|
||||
for (const [name, e] of Object.entries(all)) {
|
||||
if (name.includes("workspace")) continue;
|
||||
if (name.includes("workspace") || name.includes("quick")) continue;
|
||||
const notes = [];
|
||||
const near = (label, a, b, tolerance = 1) => { if (a != null && b != null && Math.abs(a - b) > tolerance) notes.push(`${label}: ${a} vs ${b}`); };
|
||||
const phone = e.viewport[0] < 600;
|
||||
|
||||
@@ -30,7 +30,7 @@ const states = {
|
||||
};
|
||||
const share = [["click", "开始分享"], ["wait", 900], ["click", "分享窗口:Sketchbook"], ["wait", 1500]];
|
||||
const scenarios = [];
|
||||
const add = (name, layout, state, size, extra = {}) => scenarios.push({ name, url: `${base}${layout === "workspace" ? "" : `&layout=${layout}`}${states[state]}`, size: sizes[size], ...extra });
|
||||
const add = (name, layout, state, size, extra = {}) => scenarios.push({ name, url: `${base}${layout === "workspace" ? "" : `&layout=${layout}`}${states[state]}${extra.minimal ? "&minimal" : ""}`, size: sizes[size], ...extra });
|
||||
for (const size of [1360, 1024, 390]) for (const state of ["empty", "s1", "s2", "s4", "failed", "offline", "long"]) add(`${state}-${size}`, "living", state, size);
|
||||
for (const size of [1360, 390]) add(`own-${size}`, "living", "empty", size, { steps: share });
|
||||
add("s1-1600", "living", "s1", 1600); add("empty-1600", "living", "empty", 1600);
|
||||
@@ -66,6 +66,10 @@ add("t-overlay-escape", "living", "s1", 1360, { steps: [["click", list], ["wait"
|
||||
add("t-overlay-outside", "living", "s1", 1360, { steps: [["click", list], ["wait", 500], ["tap", 700, 300], ["wait", 400]] });
|
||||
add("t-overlay-again", "living", "s1", 1360, { steps: [["click", list], ["wait", 500], ["click", list], ["wait", 400]] });
|
||||
add("t-focus", "living", "s1", 1360, { steps: [["key", "Tab"], ["key", "Tab"], ["key", "Tab"], ["wait", 300]] });
|
||||
for (const state of ["empty", "s1", "s4"]) for (const size of [1360, "laptop"]) add(`min-${state}-${size}`, "living", state, size, { minimal: true });
|
||||
add("min-s1-1360-chat", "living", "s1", 1360, { minimal: true, steps: [["click", "聊天"], ["wait", 700]] });
|
||||
add("min-empty-1360-rooms", "living", "empty", 1360, { minimal: true, steps: [["click", "房间列表"], ["wait", 700]] });
|
||||
add("min-novoice-1360", "living", "empty", 1360, { minimal: true, steps: [["click", "退出语音"], ["wait", 700]] });
|
||||
add("voices-1360", "living", "voices", 1360);
|
||||
add("voices-s1-1360", "living", "voices1", 1360);
|
||||
add("voices-s1-fhd", "living", "voices1", "fhd");
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
cluster: cluster && { l: Math.round(cluster.l * 10) / 10, r: Math.round(cluster.r * 10) / 10, cx: Math.round((cluster.l + cluster.r) / 2 * 10) / 10 },
|
||||
tiles,
|
||||
controls: shell?.dataset.controls, head: shell?.dataset.head, rooms: shell?.dataset.rooms, pane: shell?.dataset.pane,
|
||||
lastTool: rect(document.querySelector(".c3-living-app .lr-btn .lr-cap") ?? [...document.querySelectorAll(".c3-room-tools .lr-btn svg")].filter(visible).pop()),
|
||||
lastTool: rect(document.querySelector(".c3-living-app .lr-btn .lr-cap") ?? [...document.querySelectorAll(".c3-site-bar .lr-btn svg")].filter(visible).pop()),
|
||||
couchText: Math.min(...[...document.querySelectorAll(".c3-couch .lr-pawn-name")].filter(visible).map(node => parseFloat(getComputedStyle(node).fontSize) * (node.currentCSSZoom ?? 1)), 99),
|
||||
toolSizes: [...new Set([...document.querySelectorAll(".c3-site-bar .lr-btn")].filter(visible).map(node => Math.round(node.getBoundingClientRect().height)))],
|
||||
homeMark: rect(".c3-site-home svg"), itemIcon: rect(".c3-room-link .c3-identity-mark"), itemName: rect(".c3-room-link strong"),
|
||||
|
||||
+2346
-1080
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user