feat(editor): lighter coarse handle marks, hit areas unchanged

This commit is contained in:
bchanot committed 2026-11-20 14:37:47 +01:00
1 parent 4e99305833
commit d3f6314219
4 files changed
+59 -18

No files matched your search

+1 -1
View File
@@ -749,7 +749,7 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
- [ ] Owner corrections before the trial (owner brief 2026-11-19 « Le bilan technique de U2 est encourageant », plan rev 4 Tasks 11-16, contract addendum criteria 25-31): [x] T11 « Reprendre le tracé » with board 04 C handles · [x] T12 Backspace and « + » on a vertex (Mac), group name pinned · [x] T13 focus after a touch commit · [x] T14 strip below the sticky top bar · [x] T15 why « Refaire » is unavailable · [x] T16 docs, gates, verifiers, security (final head 56a76a70; criterion 22 `up fresh`, the red environment suites and criterion 25 below 1 024 px left to the owner) · [ ] STOP for the db:trial run - [ ] Owner corrections before the trial (owner brief 2026-11-19 « Le bilan technique de U2 est encourageant », plan rev 4 Tasks 11-16, contract addendum criteria 25-31): [x] T11 « Reprendre le tracé » with board 04 C handles · [x] T12 Backspace and « + » on a vertex (Mac), group name pinned · [x] T13 focus after a touch commit · [x] T14 strip below the sticky top bar · [x] T15 why « Refaire » is unavailable · [x] T16 docs, gates, verifiers, security (final head 56a76a70; criterion 22 `up fresh`, the red environment suites and criterion 25 below 1 024 px left to the owner) · [ ] STOP for the db:trial run
- [ ] Follow-up (owner approved 2026-11-19): the rights screen pages its grants (about 10 380 rows in the sandbox render at once; admin.spec axe Target crashed, lookup timeout; same on pre-U2 56c75b1). Production risk at those volumes. - [ ] Follow-up (owner approved 2026-11-19): the rights screen pages its grants (about 10 380 rows in the sandbox render at once; admin.spec axe Target crashed, lookup timeout; same on pre-U2 56c75b1). Production risk at those volumes.
- [ ] Follow-up (owner approved 2026-11-19): the catalogue loads published versions progressively (`useCardDetails` loads 426 at once in the sandbox; catalogue-integrity times out; same on pre-U2 56c75b1). - [ ] Follow-up (owner approved 2026-11-19): the catalogue loads published versions progressively (`useCardDetails` loads 426 at once in the sandbox; catalogue-integrity times out; same on pre-U2 56c75b1).
- [ ] `shortcut:` the « − » bubble for a mouse is 28 × 22 px, read off board 05 (R-9 gives only the touch size), `apps/app/src/editor/annotations/handleSize.ts`. Upgrade: the owner's value at the trial (U2 Task 5). - [x] `shortcut:` the « − » bubble for a mouse is 28 × 22 px, read off board 05 (R-9 gives only the touch size), `apps/app/src/editor/annotations/handleSize.ts`. Upgrade: the owner's value at the trial (U2 Task 5). settled by the owner trial 2026-11-20
- [x] (criterion 25, 23865071: a `scroll-margin-top` of the bar height plus 0.5 rem on the editor page's focusables outside the drawing place, `styles/index.css`) No `scroll-padding-top` under the sticky top bar (pre-existing, WCAG 2.4.11): a keyboard focus on the header's « Défaire », « Refaire » or « Enregistrer » while scrolled can stay hidden under it; axe target-size flags them once a list click scrolled the page (U2 Task 5 review M-3). - [x] (criterion 25, 23865071: a `scroll-margin-top` of the bar height plus 0.5 rem on the editor page's focusables outside the drawing place, `styles/index.css`) No `scroll-padding-top` under the sticky top bar (pre-existing, WCAG 2.4.11): a keyboard focus on the header's « Défaire », « Refaire » or « Enregistrer » while scrolled can stay hidden under it; axe target-size flags them once a list click scrolled the page (U2 Task 5 review M-3).
- [x] At the page's end, a side panel that shortens (the issue list leaving it) clamps the scroll and moves the canvas by its height (11 px in `editor-geometry.spec.ts`, which starts from the top for that reason). Gone with Task 6: the column keeps the overview, the issue is in the strip and the dialog. `editor-geometry.spec.ts` now runs the accepted repair (the issue leaving) from the page's end under `expectNoShift`, buttons pressed in place, scroll position unchanged (U2 Task 5 fix round 1, closed by Task 6 fix round 1). - [x] At the page's end, a side panel that shortens (the issue list leaving it) clamps the scroll and moves the canvas by its height (11 px in `editor-geometry.spec.ts`, which starts from the top for that reason). Gone with Task 6: the column keeps the overview, the issue is in the strip and the dialog. `editor-geometry.spec.ts` now runs the accepted repair (the issue leaving) from the page's end under `expectNoShift`, buttons pressed in place, scroll position unchanged (U2 Task 5 fix round 1, closed by Task 6 fix round 1).
- [x] (U2 Task 7: `CreationPanel`, `formProblem` and the two keys removed; the creation dialog uses `missingFields`) `shortcut:` the creation panel still shows the general lines `editor.annotations.required.fields` / `.names`, which R-3 removes (`apps/app/src/components/editor/annotations/CreationPanel.tsx`, `formProblem` in `creation.ts`). Upgrade: Task 7's creation dialog uses `missingFields` and the `editor.annotations.missing.*` keys, then the two keys and `formProblem` go (U2 Task 6 review Minor 6). - [x] (U2 Task 7: `CreationPanel`, `formProblem` and the two keys removed; the creation dialog uses `missingFields`) `shortcut:` the creation panel still shows the general lines `editor.annotations.required.fields` / `.names`, which R-3 removes (`apps/app/src/components/editor/annotations/CreationPanel.tsx`, `formProblem` in `creation.ts`). Upgrade: Task 7's creation dialog uses `missingFields` and the `editor.annotations.missing.*` keys, then the two keys and `formProblem` go (U2 Task 6 review Minor 6).
@@ -199,10 +199,12 @@ function Remove({
onKeyDown: (event: KeyboardEvent) => void onKeyDown: (event: KeyboardEvent) => void
}) { }) {
const { unit, sizes } = scale const { unit, sizes } = scale
const w = sizes.bubble.w * unit const hitW = sizes.bubble.w * unit
const h = sizes.bubble.h * unit const hitH = sizes.bubble.h * unit
const x = at[0] - w / 2 const w = sizes.bubbleMark.w * unit
const y = at[1] - (sizes.vertex / 2 + 6) * unit - h const h = sizes.bubbleMark.h * unit
const cx = at[0]
const cy = at[1] - (sizes.vertex / 2 + 6) * unit - hitH / 2
const fill = disabled const fill = disabled
? 'var(--color-ink-muted)' ? 'var(--color-ink-muted)'
: 'var(--color-danger-strong)' : 'var(--color-danger-strong)'
@@ -217,23 +219,30 @@ function Remove({
onKeyDown={onKeyDown} onKeyDown={onKeyDown}
> >
<rect <rect
x={x} x={cx - hitW / 2}
y={y} y={cy - hitH / 2}
width={hitW}
height={hitH}
fill="transparent"
data-handle={JSON.stringify({ kind: 'remove', index })}
className={`pointer-events-auto ${disabled ? 'cursor-not-allowed' : 'cursor-pointer'}`}
/>
<rect
x={cx - w / 2}
y={cy - h / 2}
width={w} width={w}
height={h} height={h}
rx={6 * unit} rx={6 * unit}
fill={fill} fill={fill}
data-handle={JSON.stringify({ kind: 'remove', index })}
className={`pointer-events-auto ${disabled ? 'cursor-not-allowed' : 'cursor-pointer'}`}
/> />
<path <path
d={`M ${x + w * 0.3} ${y + h / 2} H ${x + w * 0.7}`} d={`M ${cx - w * 0.2} ${cy} H ${cx + w * 0.2}`}
stroke="white" stroke="white"
{...LINE} {...LINE}
/> />
<rect <rect
x={x - 3 * unit} x={cx - w / 2 - 3 * unit}
y={y - 3 * unit} y={cy - h / 2 - 3 * unit}
width={w + 6 * unit} width={w + 6 * unit}
height={h + 6 * unit} height={h + 6 * unit}
rx={8 * unit} rx={8 * unit}
@@ -6,26 +6,28 @@ export interface HandleSizes {
insert: number insert: number
/** The radius around a handle's centre that a press reaches. */ /** The radius around a handle's centre that a press reaches. */
hit: number hit: number
/** The « − » bubble over the chosen vertex. */ /** The « − » bubble over the chosen vertex: its hit rectangle. */
bubble: { w: number; h: number } bubble: { w: number; h: number }
/** The « − » bubble as drawn, centred in its hit rectangle. */
bubbleMark: { w: number; h: number }
} }
// shortcut: the fine bubble size is read off board 05 (no number given by R-9). Upgrade:
// take the owner's value if the trial asks for another.
const FINE: HandleSizes = { const FINE: HandleSizes = {
vertex: 12, vertex: 12,
insert: 16, insert: 16,
hit: 10, hit: 10,
bubble: { w: 28, h: 22 }, bubble: { w: 28, h: 22 },
bubbleMark: { w: 28, h: 22 },
} }
const COARSE: HandleSizes = { const COARSE: HandleSizes = {
vertex: 18, vertex: 14,
insert: 24, insert: 18,
hit: 22, hit: 22,
bubble: { w: 44, h: 36 }, bubble: { w: 44, h: 36 },
bubbleMark: { w: 32, h: 26 },
} }
function deviceSizes(): HandleSizes { export function deviceSizes(): HandleSizes {
const coarse = const coarse =
typeof window.matchMedia === 'function' && typeof window.matchMedia === 'function' &&
window.matchMedia('(any-pointer: coarse)').matches window.matchMedia('(any-pointer: coarse)').matches
@@ -0,0 +1,30 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import { deviceSizes } from '@/editor/annotations/handleSize'
const coarse = (matches: boolean) =>
vi.spyOn(window, 'matchMedia').mockReturnValue({ matches } as MediaQueryList)
afterEach(() => vi.restoreAllMocks())
describe('handle sizes (owner trial 2026-11-20)', () => {
it('a finger gets lighter marks and unchanged hit areas', () => {
coarse(true)
expect(deviceSizes()).toEqual({
vertex: 14,
insert: 18,
hit: 22,
bubble: { w: 44, h: 36 },
bubbleMark: { w: 32, h: 26 },
})
})
it('a mouse keeps its sizes, the mark filling its hit rectangle', () => {
coarse(false)
expect(deviceSizes()).toEqual({
vertex: 12,
insert: 16,
hit: 10,
bubble: { w: 28, h: 22 },
bubbleMark: { w: 28, h: 22 },
})
})
})