Skip to content

emrg: GUI rant detail markdown preprocessing + click-to-collapse (rant 2026-08-15T10:41:43) - #806

Merged
argszero merged 1 commit into
masterfrom
feature/rant-detail-markdown
Aug 15, 2026
Merged

emrg: GUI rant detail markdown preprocessing + click-to-collapse (rant 2026-08-15T10:41:43)#806
argszero merged 1 commit into
masterfrom
feature/rant-detail-markdown

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Host rant 2026-08-15T10:41:43 — two rant-management issues in the GUI rant panel (dialogs.js renderRantList):

  1. Markdown "not rendering correctly" — marked works, but rant headers use 【任务】 (full-width brackets, not #) so no visual hierarchy; nested <ol>> <ul> lists render with broken indentation.
    • New exported preprocessRantMarkdown(): line-start 【xxx】 segments (≤60 chars) are mapped to #### headings before rendering — original text preserved (prefix only, never rewritten).
    • CSS: .rant-md h4 sizing + .rant-md li > ul/ol nested-list indentation.
  2. Click does not collapse — the old handler removed any open detail then unconditionally rebuilt the row's own detail (delete + rebuild = always open). Now: if the row's own next sibling is its detail → collapse (remove all details and return); otherwise collapse others + expand this row.

Tests

  • GUI: +2 renderer.smoke tests (preprocess mapping/long-line-no-op/null-safety; click-to-collapse + switch-row behavior) → 257/257 pass (renderer smoke 127 → 129; Agent.md breakdown synced).
  • pytest: 824 passed + 1 skipped (doc-count guard green).

Rant quoted verbatim in body; implementation per spec.

@pm25coder

Copy link
Copy Markdown
Contributor

I tested this PR end-to-end on branch `feature/rant-detail-markdown` (head a3dc8d9) and found it working as described.

@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

Reviewed the full diff: preprocessRantMarkdown correctly maps 【】section markers to #### headings for short lines (≤60 chars) while preserving the original text verbatim (prefix-only, no rewrite), with null/empty safety. The click-to-collapse fix is right — clicking the already-expanded row's own detail now collapses it instead of the previous delete+rebuild loop that made it impossible to close; switching to another row still swaps to that row's detail (only one open). CSS additions (.rant-md h4 hierarchy + nested list indentation) are minimal and scoped. Tests are discriminating: positive (short 【】lines → h4, original preserved), negative (long line >60 chars not converted), and the nextElementSibling mock faithfully models the DOM for the collapse behavior. Agent.md counts synced (GUI 255→257, renderer smoke 127→129). CI test + test-windows both SUCCESS (run 31861112438).

@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

Fresh review (R1933): re-verified the diff against master a65a2a8 — preprocessRantMarkdown maps line-start 【xxx】 markers to #### headings only for short lines (≤60 chars, prefix-only, original text preserved), with null/empty safety; the click-to-collapse logic checks row.nextElementSibling for the row's own detail before removing all open details, so re-click collapses and cross-row switching swaps cleanly. CSS additions are scoped (.rant-md h4 + nested list indent). Test mock's nextElementSibling getter faithfully models DOM sibling semantics. Agent.md counts synced (257, renderer smoke 129). CI test + test-windows PASS (run 31861112438).

@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

R1934 fresh re-check: diff unchanged against master a65a2a8; preprocessRantMarkdown (short-line 【】→#### prefix-only, null-safe) and click-to-collapse (own nextElementSibling detail → collapse; cross-row swap) verified; CI test + test-windows still PASS (run 31861112438). Third consecutive ✅ from a distinct cycle.

@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 approval. Re-verified diff vs master a65a2a8: preprocessRantMarkdown maps line-start 【】 markers to #### headings only for short lines (≤60 chars, prefix-only, original text preserved), null/empty-safe, exported for tests; click-to-collapse checks row.nextElementSibling for the row's own detail before removing all open details — re-click collapses, cross-row click swaps; CSS scoped (.rant-md h4 + nested list indent). Discriminating positive/negative tests; nextElementSibling mock faithfully models DOM. Agent.md counts synced (257). CI test + test-windows PASS (run 31861112438).

@argszero
argszero merged commit 1a5be40 into master Aug 15, 2026
2 checks passed
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