Skip to content

feat: add explicit multi-select output formats - #1658

Merged
chhoumann merged 2 commits into
masterfrom
1649-feature-request-formatting-choice-for-lists
Aug 10, 2026
Merged

feat: add explicit multi-select output formats#1658
chhoumann merged 2 commits into
masterfrom
1649-feature-request-formatting-choice-for-lists

Conversation

@chhoumann

@chhoumann chhoumann commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Multi-select output shape was inferred from context: picks became a real YAML list only when capturing into a brand-new note's front matter without a template; every other shape wrote comma-separated text. Users who capture into template-backed notes (the most common setup for people who want list properties) could not get a list at all, and nobody could get a vertical Markdown list in a note body (#1649).

This adds an explicit, opt-in |format: option to all three multi-select tokens ({{VALUE:...|multi}}, {{FILE:...|multi}}, {{FIELD:...|multi}}):

  • |format:yaml - quoted YAML flow sequence (topics: ["Alpha", "Beta"]); Obsidian reads it as a native list in any front matter, including template-backed captures.
  • |format:markdown - vertical bullet list, preserving the line's indentation.
  • |format:inline - the existing comma-separated text, now nameable.
  • |format:auto (default) - the legacy context-sensitive behavior, byte-for-byte unchanged. Nothing changes for existing setups.

It composes with the existing item options (|multi:linklist, |link, |path, |text:, |custom), and |format: without |multi warns and is ignored. The capture-time warning that previously just said "this writes comma-separated text" now points at the new flags.

Before (capture into a template-backed note - topics is a single string):

before

After (|format:yaml in front matter, |format:markdown in the body):

after

Includes docs (with "Available in the next release" callouts), unit coverage for the parser/renderer/formatter paths, and a live e2e test (tests/e2e/multi-select-formatting.test.ts) that drives a template-backed capture and asserts Obsidian's metadata cache reads a native list. Also verified interactively in Obsidian 1.13.4 (screenshots above). pnpm test (4883 tests), pnpm build-with-lint pass.

Fixes #1649

Summary by CodeRabbit

  • New Features
    • Added explicit formatting options for multi-select values, fields, and files: inline, YAML, Markdown, and automatic formatting.
    • Supports formatted output with links, labels, custom values, and other selection options.
    • Added validation and helpful warnings for unsupported or incorrectly used formatting options.
  • Documentation
    • Documented multi-select formatting syntax and available options.

@chhoumann chhoumann linked an issue Aug 9, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: af722f37-a66d-48e3-84fd-e52b16cb114c

📥 Commits

Reviewing files that changed from the base of the PR and between afd97ca and fb8bd9a.

📒 Files selected for processing (7)
  • src/engine/CaptureChoiceEngine.audit-capture.test.ts
  • src/engine/CaptureChoiceEngine.ts
  • src/utils/FieldSuggestionParser.test.ts
  • src/utils/FieldSuggestionParser.ts
  • src/utils/fileSyntax.test.ts
  • src/utils/valueSyntax.test.ts
  • src/utils/valueSyntax.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/utils/valueSyntax.test.ts
  • src/utils/FieldSuggestionParser.ts
  • src/engine/CaptureChoiceEngine.audit-capture.test.ts
  • src/utils/valueSyntax.ts
  • src/engine/CaptureChoiceEngine.ts

📝 Walkthrough

Walkthrough

Adds explicit inline, yaml, and markdown formatting for multi-select VALUE, FIELD, and FILE tokens. Updates parsing, rendering, warnings, documentation, unit tests, and end-to-end coverage.

Changes

Multi-select formatting

Layer / File(s) Summary
Format parsing and rendering
src/utils/multiValueFormat.ts, src/utils/multiValueFormat.test.ts
Adds supported format parsing and rendering for inline text, YAML arrays, and Markdown lists.
Token format parsing
src/utils/FieldSuggestionParser.ts, src/utils/valueSyntax.ts, src/utils/fileSyntax.ts, src/utils/*Syntax.test.ts
Parses format directives, validates `
Formatter output integration
src/formatters/formatter.ts, src/formatters/*test.ts, tests/e2e/multi-select-formatting.test.ts
Routes VALUE, FIELD, and FILE arrays through explicit formatting and validates formatted output.
Warnings and syntax documentation
src/engine/CaptureChoiceEngine.ts, src/engine/CaptureChoiceEngine.audit-capture.test.ts, src/utils/FieldSuggestionParser-1564-unknown-filter.test.ts, docs/src/content/docs/docs/FormatSyntax.md
Limits degradation warnings to implicit multi-select formatting and documents the new directives.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CaptureChoiceEngine
  participant FieldSuggestionParser
  participant formatter
  participant TemplateOutput
  CaptureChoiceEngine->>FieldSuggestionParser: Parse multi-select format
  FieldSuggestionParser-->>CaptureChoiceEngine: Return multiFormat
  CaptureChoiceEngine->>formatter: Format selected values
  formatter->>TemplateOutput: Emit inline, YAML, or Markdown output
Loading

Possibly related PRs

Suggested labels: released

Poem

A rabbit formats lists with care,
YAML carrots in a tidy row.
Markdown leaves float through the air,
Inline commas hop below.
Clear tokens guide each fluffy flow.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding explicit multi-select output formats.
Linked Issues check ✅ Passed The changes satisfy issue #1649 by making multi-select formatting optional and adding explicit YAML, Markdown, and inline formats for template-backed captures.
Out of Scope Changes check ✅ Passed The implementation, documentation, unit tests, and end-to-end test are directly related to the requested multi-select formatting feature.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 1649-feature-request-formatting-choice-for-lists

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 9, 2026

Copy link
Copy Markdown

Deploying quickadd with  Cloudflare Pages  Cloudflare Pages

Latest commit: fb8bd9a
Status: ✅  Deploy successful!
Preview URL: https://172ec2d1.quickadd.pages.dev
Branch Preview URL: https://1649-feature-request-formatt.quickadd.pages.dev

View logs

@chhoumann
chhoumann marked this pull request as ready for review August 10, 2026 05:48

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/engine/CaptureChoiceEngine.ts`:
- Around line 113-123: Update MULTI_SELECT_TOKEN_REGEX so the multi flag accepts
optional whitespace before its terminator, matching FieldSuggestionParser.parse
behavior for forms such as `|multi }`. Add a regression case in the
CaptureChoiceEngine audit tests that verifies this token still triggers the
contextual multi-select warning.

In `@src/utils/FieldSuggestionParser.ts`:
- Around line 314-319: Update the format parsing in the FIELD/FILE flow around
the multiSelect and multiFormat check to track whether a format directive was
explicitly provided, rather than relying on the resolved format value; warn and
reset to auto whenever format:auto is supplied without multi. Apply the same
correction in the VALUE-token parser in valueSyntax.ts, and add regression tests
covering FIELD, FILE, and VALUE tokens with format:auto but no multi.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dae05a55-e963-4b29-834c-29bb9a640f1a

📥 Commits

Reviewing files that changed from the base of the PR and between 4421f93 and afd97ca.

📒 Files selected for processing (17)
  • docs/src/content/docs/docs/FormatSyntax.md
  • src/engine/CaptureChoiceEngine.audit-capture.test.ts
  • src/engine/CaptureChoiceEngine.ts
  • src/formatters/completeFormatter.test.ts
  • src/formatters/formatter-field-title-regression.test.ts
  • src/formatters/formatter-file.test.ts
  • src/formatters/formatter.ts
  • src/utils/FieldSuggestionParser-1564-unknown-filter.test.ts
  • src/utils/FieldSuggestionParser.test.ts
  • src/utils/FieldSuggestionParser.ts
  • src/utils/fileSyntax.test.ts
  • src/utils/fileSyntax.ts
  • src/utils/multiValueFormat.test.ts
  • src/utils/multiValueFormat.ts
  • src/utils/valueSyntax.test.ts
  • src/utils/valueSyntax.ts
  • tests/e2e/multi-select-formatting.test.ts

Comment thread src/engine/CaptureChoiceEngine.ts
Comment thread src/utils/FieldSuggestionParser.ts Outdated
The degradation-warning regex missed a trimmed '|multi ' flag, and an
explicit |format:auto without |multi was a silent no-op instead of the
'needs |multi' warning the other format values get.
@chhoumann
chhoumann merged commit dd8c83e into master Aug 10, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Formatting choice for lists

1 participant