Skip to content

Commit 5a93641

Browse files
hhkaosclaude
andcommitted
docs: capture apps/editor dev-workflow and CSS gotchas from this session
Recurring friction points worth not rediscovering next time: the dev server's static files (index.html/styles.css) aren't watched and need a manual copy after every edit; the [hidden] attribute silently loses to any author display: rule unless scoped :not([hidden]) (hit repeatedly this session on different elements); native date/time inputs have a Chrome rendering-width floor CSS can't shrink below; triggering a native confirm()/beforeunload dialog via the computer tool blocks the whole browser-automation session until dismissed; and OTE's spec has no recurrence-rule concept at all (one document per occurrence, always). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DrGeVXHTNNdPi7MCgSageG
1 parent 98711f5 commit 5a93641

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ Central monorepo for the OTE organizer kit. Read DESIGN.md before any task.
2323
`pnpm build` has run. That error means the workspace is unbuilt, not broken —
2424
never "fix" it by touching imports. CI never hits it: it builds first.
2525
- Convention: connectors never invent data; absent field = absent + warning.
26+
- `apps/editor` has its own `CLAUDE.md` — dev-workflow gotchas (static
27+
files aren't watched), a recurring CSS `:not([hidden])` pitfall, and
28+
browser-testing notes specific to that app. Read it before editor work.

apps/editor/CLAUDE.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# apps/editor
2+
3+
Vanilla TypeScript + DOM event editor (no framework). `main.ts` bundles
4+
via esbuild to `dist/main.js`; `index.html`/`styles.css` are static files
5+
copied into `dist/`.
6+
7+
## Dev workflow gotcha
8+
9+
`pnpm dev` (esbuild watch + static server) only rebuilds `dist/main.js`
10+
on save. `index.html` and `styles.css` are copied into `dist/` **once**,
11+
at server startup — they are not watched. After editing either, run:
12+
13+
cp apps/editor/index.html apps/editor/styles.css apps/editor/dist/
14+
15+
before reloading the browser, or you'll be looking at stale markup/CSS.
16+
17+
## CSS: the `hidden` attribute loses to author `display` rules
18+
19+
Any CSS rule that sets `display:` on a selector that's *also* toggled via
20+
the JS `hidden` property must be scoped `:not([hidden])`. An author
21+
stylesheet rule always wins over the UA stylesheet's `[hidden] { display:
22+
none }`, regardless of specificity — so a plain `.foo { display: flex }`
23+
silently defeats `fooEl.hidden = true` elsewhere. Bitten by this
24+
repeatedly in the same session: `#profile-switch`, `.recurrence-fields`,
25+
`.field.pair`. When adding a new `display:` rule on anything toggled by
26+
`.hidden = …` in `main.ts`/`ui/form.ts`, default to `:not([hidden])`.
27+
28+
## Native date/time inputs have a rendering-width floor
29+
30+
`<input type="date">`/`<input type="time">` won't shrink below their own
31+
intrinsic minimum width in Chrome, regardless of `flex-basis`/`width`
32+
CSS. Cramming 4-5 of them into a narrow flex row (e.g. inside a
33+
`.repeater-item`) may still wrap even with generous CSS budgeting — a
34+
real platform constraint, not a CSS bug worth chasing further.
35+
36+
## Browser-testing this app: avoid getting stuck on confirm()/beforeunload
37+
38+
The app calls `window.confirm(...)` before discarding a pending import
39+
queue or replacing form content, and has a `beforeunload` handler
40+
guarding unsaved changes. Both are **native browser dialogs** — triggering
41+
one via the `computer` tool's click action blocks the whole
42+
Claude-in-Chrome session (CDP calls time out) until dismissed.
43+
- Before clicking anything that might trigger a confirm(), stub it first
44+
via `javascript_tool`: `window.confirm = () => true;`
45+
- If a `beforeunload` "Leave site?" dialog gets stuck anyway, recover by
46+
calling `navigate` again with `force: true` — it discards the dialog
47+
and proceeds.
48+
49+
## OTE has no recurrence-rule concept
50+
51+
The spec is explicit: one document per occurrence, always ("un documento
52+
= una ocurrencia. Quien publica expande."). Never store a rule in an
53+
event/feed file — a "repeat" feature must *generate* N documents, not
54+
represent recurrence as data. The spec's own guidance for an otherwise
55+
open-ended series: expand a bounded horizon ("12 meses o las próximas 12
56+
ocurrencias"), not forever — `lib/recurrence.ts`'s `MAX_OCCURRENCES` caps
57+
every generated series at 24 for this reason.

0 commit comments

Comments
 (0)