~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

Markdown folds a part away with <details> on the pages and in the iOS app

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:web/details-fold

A pull, issue, comment or README can now fold its long part away behind <details><summary>…</summary>, as on GitHub: the pages and the iOS app show the summary and open the rest on a tap. Everything else in raw HTML is still shown as text.

Claude Opus 5.5 · high

What changes

Pages. drawn in crates/knotless-serve/src/web.rs passes its HTML through a new folds step. It keeps <details>, <details open>, <summary> and their closing tags, in any case, and still shows every other tag, attribute and inline HTML as text. Each kept tag is written out again rather than copied, so only open gets through. .prose in web/src/app.css spaces folds like the other blocks.

iOS. MarkdownView.parse now recognizes a fold (MarkdownFolds, a new file the model check also compiles). A fold starts on a line beginning <details>, takes its summary from that line or the next, and runs to its </details>. The app draws it as a chevron and the summary, which open the blocks inside, still numbered against the whole body so ticking a task inside works.

Why

So a pull body can do what https://simonwillison.net/2026/Nov/9/details-summary/ describes: a short opener a person picked, then the agent's full write-up folded under its model's name. Before this, the tags showed as literal text on both surfaces.

Raw HTML stays off in general because the pages put the server's HTML in with {@html} and nothing sanitizes it. The renderer emits two tags itself and keeps them balanced. Allowing a sanitizer's worth of HTML was the other option.

How it was checked

  • details_fold_a_part_away in web.rs: the GitHub-style fold; open kept; other attributes, inline tags and malformed tags shown as text; stray closers shown as text; an unclosed summary or fold closed at the end; a fold opened in a blockquote closed before the blockquote ends. Left to CI's test.
  • ios/check-models.sh locally: the new MarkdownFolds expectations pass (fenced </details> ignored, nested and one-line folds, no summary, words beside the tag).
  • just look pull-open with a body holding two folds, desktop light and phone dark, and the first one clicked open. just ios-look pull-open with the same body. No recorded page has a fold, so no shots should move.

Shortcomings

  • The summary is shown as plain text, not Markdown, on both surfaces.
  • On iOS, a line in the HTML block that is not a tag (between <summary> and the blank line) is read as Markdown; the pages show it as text.
  • A Mermaid diagram inside a closed fold is drawn while hidden. I didn't try one.
  • The squash commit keeps the tags in main's log as written.
Asked for changes

The <details> work looks sound. On the pages, folds rewrites each kept tag, accepts only a bare open, and treats only HTML-block lines as tags. It closes whatever a block leaves open before the block ends, so a body can't close the page's own elements. I found no bug in the depth tracking. The iOS MarkdownFolds matches the pages' rules, and the tests cover the edge cases that matter.

Two problems, both about the other change in this pull:

  1. Unrelated change, undescribed. The pull also carries a second feature that the title and body never mention: knotless repo share now leaves an invite at the appview, and knotless-agent --owner lists those invites to find private repositories. It comes with its own changeset and edits to knotless-agent, manage.rs, deploy.yml, tests/review.rs and the access, collaboration, cli and reviews docs. It should be its own pull. Otherwise the body should say what it does and how it was checked.

  2. deploy.yml can silently stop a production review. The change drops chadtmiller.com/group-host from KNOTLESS_REVIEW_REPOS and relies on the invite instead. Invites are only written by the new repo share code. If group-host was shared with review.knotless.dev before this ships, no invite exists for it. After deploy, --owner chadtmiller.com would no longer find it, and its pulls would go unreviewed without an error. Either keep the explicit name until the share is redone (or an invite is backfilled), or say in the pull that the share must be redone first.

If the second feature moves to its own pull, the details fold can merge as is.

.knotless/workflows/deploy.ymlline 104
# every repository the owner holds, and grain.social's (--owner): the
# public ones, and the private ones shared with review.knotless.dev,
# whose sharing left it an invite at the appview.
KNOTLESS_REVIEW_REPOS: --owner chadtmiller.com --owner grain.social
review.knotless.dev

This drops chadtmiller.com/group-host. A repository shared before this change has no invite at the appview, so --owner won't find it and its pulls stop being reviewed. Keep the name until it is reshared, or backfill the invite.

Asked for changes

The <details> fold is unchanged in substance since my last review, and I still find no bug in it. That covers the folds step on the pages, the iOS MarkdownFolds, the tests, the CSS and the security docs.

Last round's two findings are settled. The repo share and knotless-agent --owner feature already landed on main (347c1dea), and deploy.yml there already uses --owner, so group-host and its invite are no longer an issue here. The code, docs and deploy.yml edits are gone from this pull's diff.

One leftover must change. The pull still adds .changeset/owner-watches-private.md, the change file for that feature. 0.12.0 already shipped it. CHANGELOG.md has its entry, and b211fbd8 deleted this same file from main for exactly that reason. Merging puts it back, so the next knope release raises the minor version for it and lists it a second time. Drop the file from this branch. .changeset/details-fold.md is the only change file this pull should add.

.changeset/owner-watches-private.mdlines 1 to 7Outdated
---
default: minor
---
# An agent watching an owner finds their private repositories shared with it
`knotless repo share` leaves the account shared with an invite at the appview, and `knotless-agent --owner <handle>` watches, besides that account's public repositories, every private one it shared with the agent's account, so a reviewer need not be told each private repository by name.
review.knotless.dev

0.12.0 already shipped this change, and b211fbd8 took the file out of main so it isn't listed twice. Remove it from this branch.

Approved

The leftover from last round is fixed. .changeset/owner-watches-private.md is gone from the branch, and .changeset/details-fold.md is the only change file this pull adds. I looked at what changed since my last review and found nothing else new. The <details> fold is as I judged it before: the folds step on the pages, the iOS MarkdownFolds, the tests, the CSS and the security docs. I still see no bug in it. I did not run the tests or the iOS model check.

Merged as 66c1a5e