notes
All repositories: gitoria
10.4 KB
# N5 — notes#5 reopened ("This is not working in notes"): step 1 findings (no code changed)Status: step 1 done, STOPPED before any fix. Local main (6091320) passes a–e. The most likely cause is a second reading, see "Two readings".Setup: main 6091320 in a worktree, run on a copy of the newest deploy backup (notes.worldapi.org-20261026-2000.tgz), session for az5b2 (user 0muh6o5a3kkd) written into the copy, port 8720. Headless Chrome on loreana (ports 8730–8739), real mouse clicks and real key events, viewports 1280 and 390 (mobile + touch emulation). The probe script is in N5/probe/probe.mjs (outside the repo). Chrome needs --unsafely-treat-insecure-origin-as-secure for http://notes.test, otherwise "New note" fails with "Undefined method randomUUID" (an effect of my http test origin, not a live bug; live is https).## Results per a–e (both 1280 and 390 gave the same)a) A note with a real table (header, `| --- | --- |` row, two body rows; I added it to the copy): shown as a real table (1 table, 2 th, 4 td, 1 px cell lines), not pipes. After a reload still a table. PASS.b) New note, typed with real keys `| a | b |` Enter `|---|---|` Enter: becomes a table at once (header a, b, one empty body row, caret in it); typing 1, Tab, 2 fills the row. Stored Markdown: `| a | b |` / `| --- | --- |` / `| 1 | 2 |`. PASS.c) Table button: present in the toolbar (44x44 px; at 390 in the second row, 3rd from the left), a real click inserts an empty 2x2 table with the caret in the first header cell; typing x, Tab, y works. PASS.d) Saved on the server (checked through /api/notes?id=…): real pipe tables. Reload and reopen from the list: both tables still tables. PASS.e) Server HTML of a note page (curl with the session cookie): no `<table>` tag; the note's Markdown is in the page as pipe text (it is in the seed JSON and the hidden field). By design: the MdEditor builds the table in the browser (README: "no server-side renderer"). So curl shows pipes, the browser shows the table. Not a bug as such, but it is exactly what a no-JS view, a preview, a share or a search sees.Live vs main: curl of https://notes.worldapi.org/ signed out and of the local main page: same build hash `?v=10db670bdf0d2866`, same markup; the only differences are timestamps and the ident URL. So live really is main 6091320.## Two readings of "This is not working in notes" (his words are not specific)1. A table made with the editor (typing the Markdown way or the Table button) does not work on his device. On loreana's Chrome it works at both widths. What I could not test: his phone's soft keyboard (real Android keyboards send composition/beforeinput events, not key events; the editor does handle beforeinput insertParagraph, but I have not seen it on his device). Atlas could ask him which device and whether the Table button or typing fails.2. His OWN note "DASHBOARD" (id 0mvc92mos81j, in the backup copy): its text is`DASHBOARD` / blank / `| name | device | local | tailscale |` / `| termuplex | loreana | |`— pipe rows WITHOUT a delimiter row `|---|---|`, and the second row has 3 cells vs 4. The editor (by the rule in the README, "a line with pipes but no delimiter row stays text") shows it as pipes. Screenshot N5/shots/390-dashboard.png: I saw the title and two lines of pipe text, no table. This is real data, it is exactly "markdown does not recognize tables", and it is the only note of his 28 with pipes that is table-like. If this is what he means, the fix is a decision (accept a header row without a delimiter row, or only show a "make table" action), a product choice for him/Atlas, not a bug in the editor.Not tested (not possible here): his device, the live service worker/cache on his phone (an old precached page could still serve older code; the live build is main, so a normal reload or reopening the installed app should pick it up).## Screenshots (looked at)N5/shots/390-a-open.png, 390-a-reload.png (real table with 1 px lines, toolbar two rows of 5, Table icon 3rd in row 2), 390-b-filled.png, 390-c-after-button.png, 390-d-reopen.png (two tables a/b/1/2 and x/y with empty body row), 390-dashboard.png (pipes as text); same at 1280-*.png.## Process cleanupStarted: notes server (hybriel, PID 3665814, stopped), headless Chromes (launched by the probe, closed by it). Verified: nothing of N5 listens on 8720–8739 and no Chrome with cwd in the N5 scratch.## Requests: about 30. No commits besides this report; branch n5-tables (worktree N5/wt).---# Follow-up (notes#7, his words 2026-10-29): "the table button adds a table once, but if you switch to source and back its no longer recognized same when you come in fresh."## Cause (written before the fix)`tableMd` in components/md-editor/md-editor.hl (line 624 on 6091320: `if (!any) { return '' }`, with `any` set at lines 611 and 618) returns an EMPTY string for a table whose cells are all empty. The Table button (`tableInsert`, line 1059, comment on 1058 "An all-empty table is not written to the Markdown until a cell has text") makes exactly such a table. So the Markdown the editor writes (the hidden field, the source view, the stored note) holds nothing for it. Reproduced on main at 390: Table button → table shows; "Markdown source" → textarea shows only the text above, no pipes; "Visual editor" → the table is gone; the stored note and a fresh open or reload have no table. With text in the cells, or a header only, the table is written as a real pipe table and survives everything (I tested both): the bug is only the all-empty button table, which is the first thing anyone sees after pressing the button. (The earlier step-1 test did not catch it because it typed into the second table before saving.)## Fixcomponents repo, branch n5-tables, commit 4bd1112: removed the "all empty returns nothing" rule in `tableMd` and updated the two comments and the README line. An empty button table is now written as`| | |` / `| --- | --- |` / `| | |` (the parser already reads empty header cells). Copied into notes as plain file copies (md-editor.hl, README.md, components/SOURCE = 4bd1112). Pure Hybriel, no JS.After the fix at 390: button → source view shows those three lines → back: one table (2 header, 2 body cells) → stored note has them → fresh from the list and after a reload: still the table.## Gatenotes tests/table-button.mjs (real mouse clicks and key events, 390 and 1280, copy of the newest backup with a creator session, own server on port 8721): for the variants empty, typed and header-only, it presses the Table button, opens "Markdown source", checks the three pipe lines, goes back, checks one table, checks the stored note, opens the note fresh from the list, reloads. On 6091320 (N5_APP=main checkout): 26 passed, 6 FAILED (the empty variant at 390 and 1280). On the fix: 36 passed, 0 failed.Other gates on the fix: notes tests/browser.mjs 91 passed, 0 failed. Components tests/browser.mjs: 612 passed, 1 failed ("MP: a queue pick that changes the kind (audio to video) … muteOk false", a media-player check in headless Chrome, nothing to do with tables; rerun: 613 passed, 0 failed, so the one failure was a flake).## Screenshots looked at (N5/shots/r390-*.png, wt/.scratch/table-button-*.png)r390-empty-3-back.png after the fix: note text, then an empty 2×2 table with 1 px lines, toolbar two rows, "Markdown source" button below. On main the same shot shows no table.## Process cleanup (follow-up)Notes server PID 3665814 → new one started again and stopped (PID in N5/server.pid, killed); gate servers and Chromes are closed by the gates; the components gate on port 8730 finished by itself. No process of mine listens on 8720–8739. Request count about 30 more.---# Deploy of 4bd1112 / dbf9331 and the pipes-without-delimiter change (notes#5, his "Yes")## Deploy (2026-10-29)components.hybriel (main = 4bd1112): deploy-init rc=0, 613 passed 0 failed, drained standby; outside GET loop once a second on / : 377 requests, 0 non-200. notes (main = dbf9331): rc=0, gates 91 / 76 / 3 passed, 0 failed, theme check 0 problems; GET loop 214 requests, 0 non-200. Both pushed (status main...origin/main clean). Live notes serves the new md-editor: its module's source positions shifted by the 3 removed lines (md-editor.hl:1552 against 1555 before) and the compiled code has no `any = true` of the old tableMd. Tickets notes#7 and #5: one comment each, state review (assignee was already Caramboleyo).## Pipe rows without a `| --- |` line (branch n5b-pipes in both repos; NOT deployed)Rule: a row is a line that starts with `|`; two or more such rows in a row without a delimiter row are a table, the first row is the header, short rows are padded with empty cells (DASHBOARD becomes 4 columns × 2 rows), every column left aligned. A single pipe line stays text. Rows must keep starting with `|`; the table ends at the first other line.Saving: an unchanged table is written back byte for byte (already so). A table the user changed is written with its pipe rows padded to column width and WITHOUT a `| --- |` line (flag `mdBare` on the table), except when only one row is left (then the delimiter is written, else it would turn back into text). Done cleanly, no question needed.Functions touched in components/md-editor/md-editor.hl (commit ad4e929): new `isPipeRow`; `tableAt` (third result value `bare`; the old delimiter path is unchanged, a real delimiter row still wins); `tableOf` (new parameter `bare`, keeps row 1 when bare, sets `mdBare`); the table branch of `load` (body rows of a bare table = following pipe rows); `tableMd` (skips the delimiter when `mdBare` and more than one row). Nothing else, so PV's paste change should merge.Gate: notes tests/dashboard-table.mjs (his DASHBOARD text exactly on a backup copy, 390 and 1280, real clicks and keys): table after open, Markdown not changed by opening, source view as written, source and back, reload, a cell edited by keys (no invented delimiter, edit kept), reload again. On main dbf9331: 2 passed, 4 FAILED (+ it aborts); on the fix: 14 passed, 0 failed. Other gates on the fix: notes browser.mjs 91 passed 0 failed, components browser.mjs 613 passed 0 failed.Screenshot looked at (wt/.scratch/dashboard-table-dash-390-3-edited.png): "DASHBOARD", then a 4-column table (name, device, local, tailscale; row termuplex, loreana, two empty cells, my test edit "loreZana"), then a line of text; nothing overflows.Tickets: its comments are drawn by tickets' own copy of the same MdEditor (`readonly`), client-side, no separate server renderer; so such rows show as text there until tickets takes the new MdEditor. Not changed.
Branches
- hl-standard
- hl-standard-2
- mainmain branch
- notes-pr7-kunibert
- notes13-day61
- notes17-ghost-note
- notes9-no-poll
- vendor-day56
- vendor-day59
- w7
Latest commits
- ae1075b2Preserve rejected drafts during note ID adoptionAtlas
- 383cce23|||PR Prevent saved local edits from restoring deleted notesAtlas
- 99ca1cf6Merge branch 'vendor-day56' into mainAtlas
- 649cef37|||PR Vendor Hybriel day56Atlas
- aadd0abcMerge branch 'hl-standard-2' into mainAtlas
- 52ffac9f|||PR Keyboard and reload checks for the notes gate (HL-STANDARD F21, F5)Atlas
- 617ee8c0Merge branch 'hl-standard' into mainAtlas
- 452458ee|||PR Type the function parameters of notes' own .hl files (HL-STANDARD L10)Atlas
- 23758cd6Re-vendor complete Hybriel plugins and runtime to day44mre
- 5d7cc700Backup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
- 3e07b1cfVendor complete Hybriel day39 plugin sources and librariesmre
- d7366702Check session cookie flags after login and assert anonymous GET stays cookielessmre
- 16bc8fd8Re-vendor Hybriel day38b with the mpackdb store-open race fixmre
- d860dc2dnotes#12: the markup names its own rules instead of hand-written class strings: the selected row is `aria-current="page"` (the list-first theme rule styles it, no class), the delete question is `Style.pAsk` and follows its own `open` attribute (bound to `asking`), the error line is `Style.pMessage` (body once in lib/looks.hl, rule in notes.hl, main.hl and loginfailed.hl). The CSS declarations are the same, only selectors changed (.ask -> p.ask, .ask.open -> p.ask[open], .message -> p.message); the pages look the same (AE 0 at 4 sizes). main.hl's selectorClass in/out stays (login.js reads it).mre
- 2e7f8664notes#13: the list and back links pass the note key from the loop (emit pick(e, r.key)) instead of writing data-note into the View and reading it back with getAttribute; the two window.history.replaceState calls and the identcode e.target.value read stay (hl:web has no replace-navigation, a bound hidden input is not adopted on a script's change event), see NO13 reportmre
- 4dc98282notes#15: a deleted note made in this tab leaves the list at once (the delete now removes this tab's edit under every key the row has: local id, server id); gate: browser.mjs notes#15 section, red on the old codemre
- e4e7402fnotes#11: plain declarations instead of let for variables never reassigned (components/notes.hl 3, lib/jsoncheck.hl 5, lib/util.hl 2, tools/migrate-short-ids.hl 8)mre
- 27b6a09enotes#8: Style blocks in the nested form (note-list, note-editor, .ask with their children nested, :empty as a nested pseudo-class); the same CSS rules, the pages look the samemre
- 71a9538bnotes: B27W report, log linemre
- 78ba0073notes: an ident access key (Authorization: Bearer idt_…) reads and writes its identity's notes through /api/me and /api/notes; gate tests/ident-access-notes.mjs (ident#27)mre