Skip to content

emrg: GUI task-run subtable — markdown work/reason + newest-first sort + click-to-expand cells (rant 2026-08-20T22:59:16) - #905

Merged
argszero merged 1 commit into
masterfrom
feature/gui-task-run-markdown-desc-expand
Aug 20, 2026
Merged

emrg: GUI task-run subtable — markdown work/reason + newest-first sort + click-to-expand cells (rant 2026-08-20T22:59:16)#905
argszero merged 1 commit into
masterfrom
feature/gui-task-run-markdown-desc-expand

Conversation

@argszero

Copy link
Copy Markdown
Owner

What

Host feedback (rant 2026-08-20T22:59:16) — three improvements to the GUI Tasks-view running-records subtable (buildTaskRunDetail in dialogs.js):

1. work / slowdown_reason rendered as Markdown

The cells now use window.emrgMarkdown.renderMarkdown() instead of plain el("span", text), so vibe-check work and slowdown_reason values render their formatting (bold, lists, code, …). buildTaskRunDetail became async to await the render.

2. Subtable sorted newest-first (GUI-side)

Backend recent_runs semantics are unchanged (last 5 records, ascending = oldest first, scheduler.py self.evolutions[-5:]). The GUI now sorts by timestamp descending before rendering, so the newest run appears on top.

3. Long cells: multi-line clamp + click-to-expand

  • work / slowdown_reason cells use 2-line -webkit-line-clamp + ellipsis (no more single-line nowrap hiding).
  • Clicking a whole cell expands the full content (Markdown-rendered) in a block below that record; clicking again collapses it. Cell clicks stopPropagation() so they don't toggle the task-card accordion.

Verification

  • Smoke test updated: fixture now feeds ascending records (as the backend sends them) and asserts the rendered order is newest-first; new assertions cover markdown innerHTML content and the click-expand/collapse toggle.
  • Full GUI suite: 247 pass + 7 by-design daemon-integration failures (ping/port tests against the live daemon — unchanged baseline).
  • Python suite: 983 passed + 1 skipped (no backend change).

…k-to-expand cells (rant 2026-08-20T22:59:16)

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle (1st). Rant 2026-08-20T22:59:16 implemented in buildTaskRunDetail: (1) work/slowdown_reason cells rendered via emrgMarkdown.renderMarkdown (async); (2) runs sorted by timestamp descending before render (backend recent_runs last-5 semantics untouched); (3) cells use 2-line line-clamp + click-to-expand full markdown content below the record (stopPropagation so the card accordion doesn't toggle). Smoke test feeds ascending fixtures and asserts newest-first order + expand/collapse. Local renderer.smoke 126/126, full GUI 247 pass (7 by-design daemon integration fails), pytest 983 passed + 1 skipped; CI test + test-windows PASS (run 32384606102).

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle (2nd). Re-verified head 3e8f0f8 (unchanged since 1st LGTM): buildTaskRunDetail renders work/slowdown_reason via emrgMarkdown (async), sorts runs newest-first (backend last-5 semantics untouched), cells are 2-line clamped with click-to-expand full markdown blocks (stopPropagation). Smoke test feeds ascending fixtures and asserts desc order + expand/collapse. CI test + test-windows PASS (run 32384606102); local renderer.smoke 126/126 + full GUI 247 pass verified in originating cycle.

@pm25coder

Copy link
Copy Markdown
Collaborator

Independent test report (cycle 2026-08-20, Contributor):

I tested this PR on a local checkout (head 3e8f0f8). Note the branch was forked before #904 merged, so git diff master also shows #904's changes as removals — I isolated the actual #905 changes (dialogs.js +51, components.css +34, smoke test +45) and verified them on their own.

Verified working:

  1. Markdown renderingbuildTaskRunDetail is now async; work/slowdown_reason cells render via window.emrgMarkdown.renderMarkdown(). Empty values still fall back to "-". The smoke test asserts the markdown innerHTML contains the work text (e.g. "修了双实例根因,提交 PR emrg: process-name single-instance admission + codify server-integrity test red line (rants 2026-08-18T22:15:04/23:07:14) #854").

  2. Newest-first sort — GUI-side runs.sort() by timestamp descending before render; backend recent_runs semantics untouched (correct — GUI-only change). Fixture now feeds ascending records and asserts the newest (08:00 "NTE" row) renders last in the fixture / first in output.

  3. Click-to-expand cells — 2-line -webkit-line-clamp + cursor: pointer on .task-run-cell (CSS asserted in test); clicking a cell stopPropagation()s and toggles a .task-run-expand block below that row with the full Markdown-rendered content; second click collapses. Test asserts initial all-hidden → expand on click → collapse on re-click.

Test results on this host:

No issues found. Independent confirmation of the LGTM already on the PR.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle (3rd). Head 3e8f0f8 unchanged since prior reviews; CI test + test-windows PASS (run 32384606102). Three consecutive LGTMs from independent cycles (230308, 231951, 232813) — merge approved.

@argszero
argszero merged commit 86ba2ec into master Aug 20, 2026
2 checks passed
@argszero
argszero deleted the feature/gui-task-run-markdown-desc-expand branch August 20, 2026 15:29
argszero added a commit that referenced this pull request Aug 21, 2026
…rt (fixed-port admission regression) (#906)

Since #861 (rant 2026-08-19T08:05:21) the daemon binds a FIXED loopback
port (56031) as its single-instance admission, and #884 (rant
2026-08-20T14:32:52) moved the auth credential to emrgd.token (port no
longer carried in any file). The GUI integration suite spawns its OWN
isolated daemon (HOME->tmp) — on any host where the real daemon is
already running (the normal dev-machine state), the isolated daemon
cannot bind 56031 (EADDRINUSE) and exits, so every test times out with
"daemon token file timeout" (7 failures on ). CI stays green
only because runners have no live daemon.

Fix: probe 127.0.0.1:56031 at module load; when a live daemon already
owns the fixed port, skip the whole suite with a clear message (same
mechanism as EMRG_SKIP_INTEGRATION, extended to the live-daemon state —
the isolated-daemon premise is impossible there). CI (daemon-free
runners) still runs the full suite.

Also sync Agent.md GUI test count: 260 -> 254 (renderer.smoke
131->126, i18n 16->15 drifted in #896-#905 without doc re-sync; the
doc-count guard only checks breakdown-sum consistency, not actual
collection).

Verified: pytest 984+1 green, GUI 247 pass / 0 fail (8 skipped on this
daemon-hosting host), import + --help OK.
argszero pushed a commit that referenced this pull request Sep 10, 2026
)

The doc-count guard only validated Agent.md's GUI line against *itself*
(parts sum to the headline, #584) — it could not see the test files, so
the per-file counts could drift silently. #906 hit exactly that when it
hand-synced the GUI count 260 -> 254 after #896-#905 drifted, and called
the gap out in its own message ("the doc-count guard only checks
breakdown-sum consistency, not actual collection"). R2254 later gave the
*renderer* headline a static reality check, but the GUI line stayed
unguarded.

This adds test_gui_breakdown_matches_static_counts: it globs
emrg/gui/test/*.test.js, counts the `test(`/`it(` definitions per file
(node --test reports one entry per definition, so the definition count is
the executed total), and asserts every file is documented with a matching
count — no undocumented file, no stale label, headline == the real total.
It runs in the pytest job, so no node_modules are needed.

The integration file's conditional module-level skip(<reason>) entry
(#906) is a runtime reason entry, not a definition, so it is excluded on
purpose: Agent.md's 100 counts definitions, while CI's
`EMRG_SKIP_INTEGRATION=1 npm test` prints 101 including that skip entry.

Verified positive: tests/test_doc_counts.py 6 passed; negative: corrupting
"7 integration" -> "8 integration" fails with
"Agent.md documents 8 integration GUI tests but 7 are defined ...", and
renaming a label fails with "undocumented files: ['preload-api']; stale
labels: ['preload-api-x']". Full suite 1243 collected (1175 passed,
68 skipped) — Agent.md pytest count 1242 -> 1243; import + --help OK.

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants