# Design decisions

> Accepted decisions that explain why OINK's current contracts and implementation have their present shape.

---

LLMS index: [llms.txt](/llms.txt)

---

> [!NOTE] Accepted rationale
> A decision explains why OINK selected one compatible design instead of another.
> The six contracts define the required current behavior. The implementation
> and its checkers define the executable facts.

OINK previously kept reviews, PRDs, and execution notes in a local `plan/`
directory, which made useful reasoning hard to find and allowed abandoned
designs to appear authoritative. Accepted rationale now lives here, beside the
contracts it supports, in the same bilingual, versioned site.

## Decision map {#decision-map}

| Decision                                                           | What it settles                                                                                          |
| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| [Warnings and safe fallbacks](/docs/design/decisions/diagnostics/) | Why ordinary preview survives invalid input while publication remains strict                             |
| [Configuration model](/docs/design/decisions/configuration/)       | Where configuration belongs, how pages override it, and why OINK has no parallel configuration namespace |
| [Markdown-first authoring](/docs/design/decisions/authoring/)      | Why native Markdown is preferred and Docs, Blog, Book, and Landing extend shared systems                 |
| [Generated configuration schema](/docs/design/decisions/config-schema/) | Why the editor schemas are a generated projection, and how the drift gate keeps a third configuration authority from appearing |
| [Optional CLI and result contract](/docs/design/decisions/cli/) | Independent Go executable, versioned diagnostics, coverage, and explicit write boundaries for the local CLI candidate |
| [Visual presets](/docs/design/decisions/visual-presets/) | Paper default, Slate compatibility, opt-in Appearance menu, independent mode and font boundaries |
| [Expo albums](/docs/design/decisions/expo/) | Resource bundles, optional metadata, shared appearance, and album viewing |
| [Blog gallery](/docs/design/decisions/blog-gallery/) | Article covers, shared Expo geometry, independent preferences, and readable captions |
| [Table reading](/docs/design/decisions/large-table-reading/) | Explicit `.expand`, independent `.wide`, and a direct corner action with native table restoration |
| [Translation comparison](/docs/design/decisions/document-comparison/) | One switch, real same-origin translations, a lazy two-pane reader, and heading-based sync |
| [Component refinement](/docs/design/decisions/component-refinement/) | Shared styling, divided cards, compact steps and command strips |
| [Unified diagram reading](/docs/design/decisions/diagram-reading/) | Shared Mermaid and local PlantUML viewing, source export and demand loading |
| [Local search refinement](/docs/design/decisions/local-search/) | Mixed queries, real section anchors, partial matches and section scope |
| [Keyboard map](/docs/design/decisions/keyboard-map/) | Twenty-nine single-key shortcuts in three groups, dimmed unavailable rows, local history, fold-all and a reader width |

## Record format {#record-format}

An accepted decision records its context, choice, consequences, and evidence
that the choice remains current. It does not repeat a parameter reference or
tutorial. Each decision links to its contract and verification checks, and its
English and Simplified Chinese pages change together.

When a decision changes, update the implementation, checker, affected contract,
and decision record in one delivery. Preserve the previous decision in Git
history and the release changelog rather than leaving two active answers in the
navigation tree.

## Related {#related}

- [Design contracts](/docs/design/) — current required behavior
- [Research](/docs/design/research/) — dated evidence that informs decisions
- [Proposals](/docs/design/proposals/) — ideas that have not been accepted

---

Section pages:

- [Warnings and safe fallbacks](/docs/design/decisions/diagnostics/): Invalid input produces visible warnings and safe fallbacks. Checks verify diagnostics and rendered output without aborting on every warning.
- [Configuration model](/docs/design/decisions/configuration/): Hugo and Docsy-compatible configuration, with a narrow OINK interface and no parallel configuration namespace or global resolver.
- [Markdown-first authoring](/docs/design/decisions/authoring/): Native Markdown carries common semantics, shortcodes fill capability gaps, and new content models extend shared shells.
- [Generated configuration schema](/docs/design/decisions/config-schema/): Editor schemas generated from existing configuration sources, with a CI gate that prevents drift.
- [Optional CLI and result contract](/docs/design/decisions/cli/): Executable ownership, versioned diagnostics, isolated validation, and guarded maintenance plans for the current local CLI candidate.
- [Component refinement across four visual presets](/docs/design/decisions/component-refinement/): Consistent component surfaces and controls, with three optional Markdown presentation variants.
- [Paper and Slate visual presets](/docs/design/decisions/visual-presets/): Accepted phase-one visual identity and appearance controls, with separate reader style and mode state.
- [Expo image collections](/docs/design/decisions/expo/): Record the reasons for album bundles, shared appearance, three display modes, and the image viewer.
- [Blog posts as a gallery](/docs/design/decisions/blog-gallery/): Keep articles as the content model while reusing Expo geometry for a fourth blog index view.
- [Explicit table reading](/docs/design/decisions/large-table-reading/): Separate technical table layout from an optional corner action for reading in a larger viewport.
- [Translation comparison](/docs/design/decisions/document-comparison/): Compare a page with an existing same-origin translation in a two-pane reader that loads only when asked.
- [Keyboard map](/docs/design/decisions/keyboard-map/): Record why OINK binds twenty-nine single-key shortcuts in three groups, dims what a page cannot run, and adds local history, fold-all, and a reader width.
- [Unified diagram reading](/docs/design/decisions/diagram-reading/): Shared Mermaid and local PlantUML viewing, source export and demand loading.
- [Local search refinement](/docs/design/decisions/local-search/): Mixed-language queries, technical identifiers, section results, and palette scope in OINK 1.4.0.

---

Backlinks:

- [Design](/docs/design/)
- [Proposals](/docs/design/proposals/)
- [Research](/docs/design/research/)
