Fix markdown list callout settings polish #196

Closed
opened 2026-06-01 09:59:58 +00:00 by steve · 0 comments
Owner

The list-callout merge into the Markdown plugin left the settings surface and
persisted style config in a mixed shape.

Problem

app.json can contain both legacy flat list-callout appearance keys such as
markdown.listCallouts.style.paddingLeft and the canonical object setting
markdown.listCallouts.style. The Markdown settings tab also still uses the old
text-field icon editing flow and some preview rows do not clearly show sample
text.

Goal

Make Markdown list-callout settings use one canonical appearance config shape,
use the shared icon picker for catalog icon choices, and show useful sample text
in every callout preview row.

Scope

  • Keep the dynamic callout catalog in Markdown plugin data under listCallouts.
  • Keep appearance settings canonical under markdown.listCallouts.style.
  • Migrate legacy flat style keys into the object setting when needed and remove
    the flat keys after normalization.
  • Clean the tracked e2e vault config and regenerate the demo vault fixture.
  • Replace list-callout icon text fields with the shared icon picker component.
  • Update specs and tests for the migration and settings-tab behavior.

Non-goals

  • Do not convert the dynamic callout catalog to a declarative schema.
  • Do not change list-callout parsing, rendering syntax, or default callout
    characters.
  • Do not modify unrelated settings-sidebar resize work tracked by #195.

Acceptance Criteria

  • app.json persists list-callout appearance only as
    markdown.listCallouts.style.
  • Legacy flat keys are preserved into the object setting when no object value is
    present, and removed when an object value is already present.
  • The Markdown list-callout settings tab uses the shared icon picker for icon
    selection and keeps a clear-icon action.
  • Existing and new callout preview rows display sample text alongside markers or
    icons.
  • The tracked e2e vault and generated demo vault fixture no longer include the
    legacy flat list-callout style keys.

Implementation Notes

  • Implement normalization close to the list-callout controller/style-var code so
    it is scoped to the Markdown plugin and does not rewrite unrelated config.
  • If both object and flat forms exist, prefer the object value and prune the flat
    form.
  • Continue applying CSS variables from markdown.listCallouts.style.* lookups,
    relying on the configuration accessor to resolve object-backed values.

Suggested Files or Specs To Inspect

  • packages/plugins/plugin-markdown/src/lib/list-callout/
  • packages/api/src/lib/configuration.svelte.ts
  • e2e-vault/.obsidian/app.json
  • scripts/generate-demo-vault-fixture.mjs
  • spec/src/20-packages/plugins/markdown/index.md

Validation Commands

  • pnpm --filter @lapis-notes/markdown check:all
  • Focused Vitest tests for list-callout config/settings
  • pnpm check:all
  • make spec-lint
  • mdbook build spec
  • pnpm test:smoke

Follow-up Tasks

Implementation Summary

Added Markdown list-callout style normalization that migrates legacy flat keys into markdown.listCallouts.style, prunes duplicate flat keys, updates previews and icon picker controls, cleans the e2e fixture, and covers the behavior with focused regression tests.

The list-callout merge into the Markdown plugin left the settings surface and persisted style config in a mixed shape. ## Problem `app.json` can contain both legacy flat list-callout appearance keys such as `markdown.listCallouts.style.paddingLeft` and the canonical object setting `markdown.listCallouts.style`. The Markdown settings tab also still uses the old text-field icon editing flow and some preview rows do not clearly show sample text. ## Goal Make Markdown list-callout settings use one canonical appearance config shape, use the shared icon picker for catalog icon choices, and show useful sample text in every callout preview row. ## Scope - Keep the dynamic callout catalog in Markdown plugin data under `listCallouts`. - Keep appearance settings canonical under `markdown.listCallouts.style`. - Migrate legacy flat style keys into the object setting when needed and remove the flat keys after normalization. - Clean the tracked e2e vault config and regenerate the demo vault fixture. - Replace list-callout icon text fields with the shared icon picker component. - Update specs and tests for the migration and settings-tab behavior. ## Non-goals - Do not convert the dynamic callout catalog to a declarative schema. - Do not change list-callout parsing, rendering syntax, or default callout characters. - Do not modify unrelated settings-sidebar resize work tracked by #195. ## Acceptance Criteria - `app.json` persists list-callout appearance only as `markdown.listCallouts.style`. - Legacy flat keys are preserved into the object setting when no object value is present, and removed when an object value is already present. - The Markdown list-callout settings tab uses the shared icon picker for icon selection and keeps a clear-icon action. - Existing and new callout preview rows display sample text alongside markers or icons. - The tracked e2e vault and generated demo vault fixture no longer include the legacy flat list-callout style keys. ## Implementation Notes - Implement normalization close to the list-callout controller/style-var code so it is scoped to the Markdown plugin and does not rewrite unrelated config. - If both object and flat forms exist, prefer the object value and prune the flat form. - Continue applying CSS variables from `markdown.listCallouts.style.*` lookups, relying on the configuration accessor to resolve object-backed values. ## Suggested Files or Specs To Inspect - `packages/plugins/plugin-markdown/src/lib/list-callout/` - `packages/api/src/lib/configuration.svelte.ts` - `e2e-vault/.obsidian/app.json` - `scripts/generate-demo-vault-fixture.mjs` - `spec/src/20-packages/plugins/markdown/index.md` ## Validation Commands - `pnpm --filter @lapis-notes/markdown check:all` - Focused Vitest tests for list-callout config/settings - `pnpm check:all` - `make spec-lint` - `mdbook build spec` - `pnpm test:smoke` ## Related Issues - Follow-up to #58 — [Fold list-callout into markdown plugin](../closed/58-fold-list-callout-into-markdown-plugin.md) ## Follow-up Tasks ## Implementation Summary Added Markdown list-callout style normalization that migrates legacy flat keys into markdown.listCallouts.style, prunes duplicate flat keys, updates previews and icon picker controls, cleans the e2e fixture, and covers the behavior with focused regression tests. <!-- backlog:task_id=TASK-MARKDOWN-LIST-CALLOUT-SETTINGS source_spec=spec/src/20-packages/plugins/markdown/index.md related_issue=58 -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#196
No description provided.