Skip to content

Add alignment options for the constrained document column #29

Closed

Description

@BinaryOutlook

Stage 3 — Layout and writing preferences

Synopsis

Allow a constrained visual-editor column to sit at the left, center, or right of the available pane so users control where surplus space appears.

End goal

Column placement is configurable without changing paragraph or table-cell alignment in the Markdown.

Start after

Start implementation only after every prerequisite is merged into main or has a maintainer-accepted technical freeze recorded in its linked issue. A freeze must identify the exact source/prototype commit and settled contracts; an open draft PR alone is insufficient. For an investigation prerequisite, acceptance must identify the approved design/report revision and prototype commit if one exists.

Fetch current origin/main before branching. If using a freeze, record an integration base containing all required prerequisite changes and link the freeze decisions in the PR. Validate the combined result again after the final prerequisite changes are integrated. The recorded freeze governs any agreed early start while a prerequisite issue remains open.

Agreed scope

  • Offer left, center, and right placement; center remains the initial default.
  • The preference affects the document container only when available width exceeds the configured maximum.
  • In full-width mode or a pane narrower than the cap, do not create artificial empty space to satisfy alignment.
  • Keep Source mode and export layout independent of this visual-editor preference.

Acceptance criteria

  • Each choice places the constrained column correctly across viewport and sidebar changes and persists in both hosts.
  • Paragraph text alignment, table column alignment, and source content are unchanged.
  • Floating table controls, language pickers, equation inputs, and other anchored UI remain correctly positioned after alignment changes.
  • Changing alignment preserves live selection, editing state, clean state, and undo history.

Verification

  • Measure all three placements in wide and narrow panes with default and custom caps, including full-width mode.
  • Exercise an active table and equation while changing alignment; check anchored controls and save/source invariants.
  • Verify live configuration and reopening in both hosts.

Source pointers

  • src/webview/styles.css
  • src/webview/editor.js
  • src/webview/table-toolbar.js
  • src/editorProvider.ts
  • src/shared/settings-provider.ts
  • electron/src/settings-manager.ts
  • package.json

Delivery contract

Implement the shared editor behavior in both VS Code and Electron. View-only settings/actions must preserve Markdown, selection/editing context, clean state, and undo history. For new or changed settings, keep host wiring, manifest descriptions, all supported translations, and documentation consistent. Preserve existing identifiers and defaults except for the deliberate changes specified above.

Work from the repository root using the Node version in .node-version and the maintained instructions in CONTRIBUTING.md, docs/building.md, and docs/testing/README.md; export changes also follow docs/export-verification.md. Run full compilation after webview JavaScript/CSS, shared-module, or translation changes, plus checks that exercise the changed behavior. Rebuild and reinstall for installed-extension evidence. Report failures/skips honestly; follow required CI and review gates. Update affected documentation and review any committed Markdown in source and rendered form.

Link the PR or investigation to this issue. Keep remediation on the same focused work item where practical. Completion requires the stated evidence and accepted outcome; opening a draft PR does not complete the issue. No deadline or assignee is imposed by this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions