Skip to content

Social card: stored outline, outline rows and the Heading card #666

Open

Description

@HMarzban

Part of #663 (slice 4). Needs slice 3.

Goal

Store the pad outline, draw outline rows on the Document card (R-A), and add the Heading card (R-K). The kind stays off until both replicas run the code.

Scope

  • Column. DocumentMetadata.outline (jsonb, null = never extracted). Every heading after the Title, in order, with its level, its parent and its first blocks (up to 4 lines, R-K). Measured local size: p50 233 B, p95 9,824 B, max 22,116 B.
  • Oversize rule. At most 200 items. A larger result stores truncated: true. Above 32 KiB the worker stores null, and the card falls back.
  • Worker and backfill. The same preview pass and the same backfill script as slice 3. Fail closed to null.
  • Slug read. REST selects outline and preview for the card, and never returns them to Next.
  • Document card with an outline. Pad name, then the shallowest level with 3 or more rows, then "+N more sections".
  • Heading card. id=<tocId>: the pad name as a muted line, the heading as the title, then its first blocks. An unknown id, the Title id or a null outline gives the Document card.
  • R8. A heading link copied after a chat link never carries chat values.

Not in this slice

Chat count pills on outline rows (R-B, later). The picture variant (R-I, later).

Acceptance checks

  • TOC Copy link, digest and Focus section links give the Heading card.
  • An unknown id and an oversized outline give the Document card.
  • Each card matches its approved r4c PNG.

Activity

  1. added
    enhancement
    on Nov 1, 2026
  2. HMarzban commented on Nov 1, 2026

    @HMarzban
    CollaboratorAuthor

    Built on main and checked locally, not committed yet. Status and the checks owed before switch-on are in #663 (comment of 2026-11-01).

  3. HMarzban commented on Nov 3, 2026

    @HMarzban
    CollaboratorAuthor

    Status, 2026-11-03. The stored outline, the outline rows and the Heading card are pushed and deployed on 2026-11-03, in 34116d296 and 674dfc189. The outline is stored in DocumentMetadata.cardData, not in its own column. Left:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Featureenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions