notes
All repositories: gitoria
7.5 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.
Branches
Latest commits
- dbf93319N5 report: components gate rerun 613 passed, 0 failedmre
- 3a8bc0d2N5: empty Table-button table is written as a real pipe table (MdEditor 4bd1112, plain copy); gate tests/table-button.mjs; reportmre
- c16bd443N5: step 1 report (tables pass locally; his DASHBOARD note has no delimiter row)mre
- 6091320anotes: MdEditor 7437e32 (surface drawn at once when the page is claimed); gate measures claim-to-text on 5 note loads at 1280 and 390mre
- 0aa9277enotes: move each component's styles into its own Style block (shell and header selector in main.hl, list, editor frame and delete question in notes.hl); styles.hl keeps the theme inherit, the accent and the message colour; .gitignore ignores a bin symlink too; tests/shots.mjs for the pixel comparemre
- 9ba01de3notes: write the standby service out in full so the boot gate can read the main servicemre
- 98cab40anotes: standby service on its port plus 10 and a deploy that hands over through it without a gapmre
- 1fadb473notes gate: the editor table now has 1 px cell lines from the notes thememre
- 8762115cnotes: take the components e54f83a (paste as Markdown, text typed before the editor is built is kept, Table button); table lines come from the notes thememre
- ac23e194ident#31: the selector's sign-in returns to the page the user started on (return attribute = the login callback with next), gate checkmre
- 2804f0d3Merge branch 'iw-ident-widget'mre
- 52d8d242notes: e2e script checks Log out and the selector in the header instead of the user menumre
- e5abf7b7notes header: the selector alone top right plus Log out as before the theme missions; the user icon is gonemre
- a2e343aeident selector back in the header (creator 2026-10-24): selector top right signed in and out on phone and desktop, no second Log in button, new gate checks (WIP: gates not re-run after the last edits)mre
- 7a889b82notes: MdEditor with the Table button, typed pipe rows and the theme's table look (components mt-tables); a table note is named by its header words; gate checks that fail on mainmre
- b96c7f70theme: sync from layouts 4994037 (list rows stack, td word-keep, heading code, edited tap target)mre
- 6140e6a0sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
- cb7e6469deploy: security gate (tests/security.mjs)mre
- 774bf34bnotes security: CSRF guard on /api/notes, new session at login, Secure cookie, uploadMax 0, login rate limit, nosniff, face payload check; tests/security.mjs; SN reportmre
- ef18a68fsync components.hybriel 214c318: MdEditor on a phone, two even toolbar rows of 44 px targets, label 15 px, table head 16 px (E2)mre