Skip to content

docs: add contributor placement guide for SuperDoc layers#3278

Merged
caio-pizzol merged 1 commit into
mainfrom
caio-pizzol/architecture-docs-routing
May 14, 2026
Merged

docs: add contributor placement guide for SuperDoc layers#3278
caio-pizzol merged 1 commit into
mainfrom
caio-pizzol/architecture-docs-routing

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

Adds a central placement guide for SuperDoc layers, so contributors and agents land in the right package without learning the boundaries by trial. Docs-only — no code or behavior change.

What lands:

  • Root CLAUDE.md (which root AGENTS.md follows via symlink) gets an 11-row "Where To Put Your Change" routing table replacing the previous 3-row "Where visual changes go" version. Covers DOCX import/export, style cascade, static visuals, direction-aware properties, editing behavior, ephemeral editor UI (with the DecorationBridge / CommentHighlightDecorator / search-exclusion / Vue overlay specifics), interaction mapping, geometry, final DOM rendering, presentation state bridge, document-API operations, and consumer SDK/CLI surface. The rendering-flow arrow now starts at super-converter so the entry isn't implicit.
  • A "Quick Boundary Checks" section with three rg commands that surface the most common layer-leak patterns (painter upstream imports, pm-adapter DOM work, importer baking style cascade). Agent-friendly: rules become greppable, not just prose.
  • packages/layout-engine/AGENTS.md (CLAUDE.md follows via symlink) gets a "Layer Ownership" rewrite that cross-references root and adds direction-axes + w:bidiVisual reminders local to the package.

What's untouched and why:

  • packages/superdoc/AGENTS.md — consumer-facing, ships with the npm package. Its sibling CLAUDE.md (internal) is intentionally separate; merging would either pollute the npm-shipped doc with contributor rules or strip the internal navigation map.

Companion / sequencing:

Verified:

  • cmp CLAUDE.md AGENTS.md → identical (root symlink resolves).
  • Grep checks in the new doc all run cleanly.

A central routing map for "where do I put my change?" so contributors and
agents land in the right layer without learning the boundaries by trial.

Root CLAUDE.md (which root AGENTS.md follows via symlink):

- Rewrite the rendering-flow arrow to include super-converter as the entry
  (.docx -> super-converter -> hidden PM -> pm-adapter+style-engine -> ...).
- Replace the 3-row "Where visual changes go" table with an 11-row "Where
  To Put Your Change" routing table covering: DOCX import/export, style
  cascade, static visuals, direction-aware properties, editing behavior,
  ephemeral editor UI, interaction mapping, geometry/pagination, final
  DOM rendering, presentation state bridge, document-API operations,
  consumer SDK/CLI surface.
- Add a "Quick Boundary Checks" section with rg commands that surface the
  three most common layer-leak patterns (painter upstream imports,
  pm-adapter DOM work, importer baking style cascade).

packages/layout-engine/AGENTS.md (CLAUDE.md follows via symlink):

- Rename the "Key Insight" header to "DomPainter Receives Paint-Ready
  Data" (the existing 'dumb' wording was a tone choice the new copy
  drops).
- Replace the "Rendering Ownership" block with a "Layer Ownership"
  section that cross-references root CLAUDE.md and adds direction-axes
  + bidiVisual single-mirror reminders local to the package.

packages/superdoc/AGENTS.md is intentionally untouched: it is consumer-
facing and ships with the npm package.

No behavior change. Docs only.
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 14, 2026 09:49
@caio-pizzol caio-pizzol merged commit c04e785 into main May 14, 2026
21 checks passed
@caio-pizzol caio-pizzol deleted the caio-pizzol/architecture-docs-routing branch May 14, 2026 09:51
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

caio-pizzol added a commit that referenced this pull request May 14, 2026
…umers (SD-3138)

Centralize the read of table visual direction (w:bidiVisual, ECMA-376
section 17.4.1) through one helper, mirroring the paragraph-axis pattern
already established for getParagraphInlineDirection.

- Add getTableVisualDirection(attrs) to @superdoc/contracts. Reads
  attrs.tableDirectionContext.visualDirection first (future-ready for
  when pm-adapter writes the resolved context onto TableAttrs), falls
  back to attrs.tableProperties.rightToLeft (or bidiVisual alias) for
  compatibility.
- Migrate three consumers off raw reads:
  - layout-engine/src/layout-table.ts (table-frame X positioning)
  - painters/dom/src/table/renderTableFragment.ts (visual mirror gate)
  - super-editor/.../tableBoundaryNavigation.js (RTL cursor nav)

Out of scope for this PR:
- pm-adapter wiring that populates TableAttrs.tableDirectionContext.
  Phase 1B - the helper is future-ready but the context isn't written
  yet, so the fallback path is exercised today.
- packages/super-editor/.../TableResizeOverlay.vue reads a different
  shape (tableMetadata.value.rtl); migration deferred to keep this PR
  scoped.

Companion to SD-3134 and PRs #3272/#3273/#3278; under SD-2771 Wave 3.

Tests:
- 14 unit tests for getTableVisualDirection (precedence, alias, no
  signal, null fallback).
- 174 painter table tests, 652 layout-engine tests, 189 super-editor
  table extension tests all pass.
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

🎉 This PR is included in @superdoc-dev/mcp v0.3.0-next.90

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

🎉 This PR is included in vscode-ext v2.3.0-next.135

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

🎉 This PR is included in @superdoc-dev/react v1.2.0-next.133

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

🎉 This PR is included in superdoc-cli v0.8.0-next.105

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

🎉 This PR is included in superdoc-sdk v1.8.0-next.89

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

🎉 This PR is included in superdoc v1.30.0-next.87

The release is available on GitHub release

caio-pizzol added a commit that referenced this pull request May 14, 2026
…umers (SD-3138) (#3279)

Centralize the read of table visual direction (w:bidiVisual, ECMA-376
section 17.4.1) through one helper, mirroring the paragraph-axis pattern
already established for getParagraphInlineDirection.

- Add getTableVisualDirection(attrs) to @superdoc/contracts. Reads
  attrs.tableDirectionContext.visualDirection first (future-ready for
  when pm-adapter writes the resolved context onto TableAttrs), falls
  back to attrs.tableProperties.rightToLeft (or bidiVisual alias) for
  compatibility.
- Migrate three consumers off raw reads:
  - layout-engine/src/layout-table.ts (table-frame X positioning)
  - painters/dom/src/table/renderTableFragment.ts (visual mirror gate)
  - super-editor/.../tableBoundaryNavigation.js (RTL cursor nav)

Out of scope for this PR:
- pm-adapter wiring that populates TableAttrs.tableDirectionContext.
  Phase 1B - the helper is future-ready but the context isn't written
  yet, so the fallback path is exercised today.
- packages/super-editor/.../TableResizeOverlay.vue reads a different
  shape (tableMetadata.value.rtl); migration deferred to keep this PR
  scoped.

Companion to SD-3134 and PRs #3272/#3273/#3278; under SD-2771 Wave 3.

Tests:
- 14 unit tests for getTableVisualDirection (precedence, alias, no
  signal, null fallback).
- 174 painter table tests, 652 layout-engine tests, 189 super-editor
  table extension tests all pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants