Skip to content

Conversation

@chhoumann
Copy link
Owner

@chhoumann chhoumann commented Dec 22, 2025

Summary

  • add |type:multiline parsing for VALUE tokens with warnings for unsupported/option-list usage
  • route token-level input type through sequential prompts and one-page input (textarea + backslash escaping)
  • update docs and add tests for parsing, requirement collection, and input prompt selection

Fixes #339.

Testing

  • bun run test

Summary by CodeRabbit

  • New Features

    • Added a VALUE option to force multi-line textarea inputs and mixed-mode (single-line title + multi-line body).
    • Per-field input overrides now drive which input control (single-line vs wide/multiline) is shown and propagate label/default/description into prompts.
  • Bug Fixes / Behavior

    • One-page modal now sanitizes textarea values (escapes backslashes) before output.
  • Documentation

    • Format syntax and advanced docs updated with multiline option, constraints, and examples.
  • Tests

    • Added tests covering multiline parsing and prompt selection.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
quickadd Ready Ready Preview Dec 23, 2025 4:16pm

@coderabbitai
Copy link

coderabbitai bot commented Dec 22, 2025

Walkthrough

Adds a per-VALUE multiline option (|type:multiline) and threads parsed input-type metadata through parsing, formatter, requirement collection, and input-prompt selection; updates regex to match filtered NAME/VALUE forms and escapes textarea values in the one-page modal.

Changes

Cohort / File(s) Change Summary
Documentation
docs/docs/Advanced/onePageInputs.md, docs/docs/FormatSyntax.md
Document new `{{VALUE
Value Syntax Parsing & Tests
src/utils/valueSyntax.ts, src/utils/valueSyntax.test.ts
Add ValueInputType = "multiline", extend parsed types with inputTypeOverride, implement resolveInputType and parseAnonymousValueOptions, propagate inputTypeOverride and emit warnings for invalid uses; add tests for multiline parsing and warnings.
Regex Constants
src/constants.ts
Broaden NAME_VALUE_REGEX to match {{NAME}}/{{VALUE}} with optional `
Input Prompt Factory & Tests
src/gui/InputPrompt.ts, src/gui/InputPrompt.test.ts
Add factory(inputTypeOverride?: ValueInputType), short-circuit to wide/textarea prompt when override is "multiline", preserve global-setting fallback; add tests for override, global multiline, and single-line default.
Formatter & Complete Formatter
src/formatters/formatter.ts, src/formatters/completeFormatter.ts
Add inputTypeOverride to PromptContext, new valuePromptContext and getValuePromptContext to extract description/default/inputType from anonymous options, and pass input-type/default/description into prompt factory calls.
Requirement Collection & Tests
src/preflight/RequirementCollector.ts, src/preflight/RequirementCollector.test.ts
Compute baseInputType (textarea vs text) from parsed inputTypeOverride or plugin settings for variable/value prompts; propagate description/defaultValue and add tests for named/anonymous VALUE multiline handling and global settings.
One-Page Input Modal
src/preflight/OnePageInputModal.ts
Escape backslashes in textarea-type inputs when composing resolved outputs via new helper to preserve textarea content.

Sequence Diagram(s)

sequenceDiagram
    participant Parser as ValueSyntax Parser
    participant Formatter as Formatter
    participant ReqCollector as RequirementCollector
    participant GUI as InputPrompt Factory
    participant Modal as OnePageInputModal

    Parser->>Formatter: parse token (include inputTypeOverride, label, default)
    Formatter->>ReqCollector: set valuePromptContext (inputTypeOverride, label, default)
    ReqCollector->>GUI: request field requirement (type: textarea or text)
    GUI-->>ReqCollector: return prompt component (wide/text)
    ReqCollector->>Formatter: gather responses
    Formatter->>Modal: compose output (textarea values escaped)
    Modal-->>Formatter: final resolved output
    note right of GUI `#DDEBF7`: inputTypeOverride short-circuits global setting\n(if "multiline" -> wide prompt)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

released

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 accurately summarizes the main change: adding per-token multiline VALUE input support instead of global-only configuration.
Linked Issues check ✅ Passed The changes implement the core requirement from issue #339: enable per-token multiline input via |type:multiline syntax on VALUE tokens, allowing individual capture macros to specify multiline behavior independently.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing per-token multiline VALUE input support. Updates include parsing, routing, prompting, requirement collection, documentation, and tests—all aligned with the feature request.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 339

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 138a017 and 7aa127a.

📒 Files selected for processing (6)
  • src/formatters/completeFormatter.ts
  • src/formatters/formatter.ts
  • src/gui/InputPrompt.ts
  • src/preflight/RequirementCollector.ts
  • src/utils/valueSyntax.test.ts
  • src/utils/valueSyntax.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/preflight/RequirementCollector.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,mts,mjs,js,json}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,mts,mjs,js,json}: Use tab indentation with width 2 in TypeScript and configuration files (enforced by Biome).
Follow an 80-character line guide (enforced by Biome).

Files:

  • src/utils/valueSyntax.ts
  • src/formatters/completeFormatter.ts
  • src/formatters/formatter.ts
  • src/gui/InputPrompt.ts
  • src/utils/valueSyntax.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use camelCase for variables and functions in TypeScript.
Prefer type-only imports in TypeScript.

Files:

  • src/utils/valueSyntax.ts
  • src/formatters/completeFormatter.ts
  • src/formatters/formatter.ts
  • src/gui/InputPrompt.ts
  • src/utils/valueSyntax.test.ts
**/*.{ts,tsx,svelte}

📄 CodeRabbit inference engine (AGENTS.md)

Use PascalCase for classes and Svelte components.

Files:

  • src/utils/valueSyntax.ts
  • src/formatters/completeFormatter.ts
  • src/formatters/formatter.ts
  • src/gui/InputPrompt.ts
  • src/utils/valueSyntax.test.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Route logging through the logger utilities for consistent output.

Files:

  • src/utils/valueSyntax.ts
  • src/formatters/completeFormatter.ts
  • src/formatters/formatter.ts
  • src/gui/InputPrompt.ts
  • src/utils/valueSyntax.test.ts
src/{engine,services,utils}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Structure production code so Obsidian dependencies are injected behind interfaces to enable unit testing without loading real Obsidian modules.

Files:

  • src/utils/valueSyntax.ts
  • src/utils/valueSyntax.test.ts
🧠 Learnings (2)
📚 Learning: 2025-12-21T07:54:34.863Z
Learnt from: CR
Repo: chhoumann/quickadd PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T07:54:34.863Z
Learning: Applies to src/{engine,services,utils}/**/*.{ts,tsx} : Structure production code so Obsidian dependencies are injected behind interfaces to enable unit testing without loading real Obsidian modules.

Applied to files:

  • src/utils/valueSyntax.test.ts
📚 Learning: 2025-12-21T07:54:34.863Z
Learnt from: CR
Repo: chhoumann/quickadd PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T07:54:34.863Z
Learning: Applies to tests/**/*.{ts,tsx} : Unit tests should target pure logic and swap in adapters or use `tests/obsidian-stub.ts` for Obsidian dependencies.

Applied to files:

  • src/utils/valueSyntax.test.ts
🧬 Code graph analysis (3)
src/formatters/completeFormatter.ts (2)
src/gui/InputPrompt.ts (1)
  • InputPrompt (6-17)
docs/static/scripts/userScriptExample.js (1)
  • description (141-145)
src/formatters/formatter.ts (1)
src/utils/valueSyntax.ts (2)
  • ValueInputType (4-4)
  • parseAnonymousValueOptions (239-276)
src/utils/valueSyntax.test.ts (1)
src/utils/valueSyntax.ts (2)
  • parseValueToken (195-237)
  • parseAnonymousValueOptions (239-276)
🪛 ast-grep (0.40.3)
src/formatters/formatter.ts

[warning] 177-177: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(NAME_VALUE_REGEX.source, "gi")
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🔇 Additional comments (14)
src/gui/InputPrompt.ts (1)

4-16: LGTM! Clean implementation of input type override.

The factory method correctly prioritizes the token-level inputTypeOverride over the global setting, enabling per-VALUE multiline behavior as intended. The type-only import follows coding guidelines.

src/formatters/completeFormatter.ts (2)

177-199: LGTM! Correct propagation of input type override.

The prompt factory is correctly instantiated with inputTypeOverride from valuePromptContext, and the conditional branching for linkSourcePath properly passes context values to both prompt variants.


228-235: LGTM! Input type override correctly threaded through variable prompts.

The factory method properly receives context?.inputTypeOverride, enabling per-token multiline behavior for VALUE variables.

src/utils/valueSyntax.test.ts (3)

1-12: LGTM! Proper test isolation with cleanup.

The addition of vi.restoreAllMocks() in afterEach ensures console spy mocks are properly cleaned up between tests, preventing test pollution.


51-79: LGTM! Comprehensive test coverage for multiline parsing.

The tests properly validate:

  • Successful parsing of type:multiline with options
  • Shorthand default being ignored when type is present
  • Warning emissions for unknown types and invalid usage (option lists)

Good use of vi.spyOn to verify warning behavior without polluting console output.


82-102: LGTM! Test coverage for anonymous VALUE tokens.

The tests properly validate parseAnonymousValueOptions behavior, mirroring the coverage for named tokens and ensuring consistent parsing across both code paths.

src/utils/valueSyntax.ts (4)

4-18: LGTM! Clean type definitions.

The ValueInputType literal type and inputTypeOverride field are well-integrated into the existing parsing structure. The type is defined as a literal "multiline" which will naturally extend to a union type when additional input types are added.


126-167: LGTM! Consistent option parsing.

The type option is properly integrated into the existing option parsing flow, following the same patterns as label, default, and custom options.


170-193: LGTM! Robust validation with helpful warnings.

The resolveInputType function properly validates the input type and emits clear warnings for:

  • Unsupported type values
  • Incompatible usage (option lists with multiline)

Returning undefined on validation failure provides graceful degradation to default behavior.


217-276: LGTM! Complete parsing implementation.

Both parseValueToken and parseAnonymousValueOptions properly compute inputTypeOverride and include it in their return values. The tokenDisplay construction provides helpful context for validation warnings.

src/formatters/formatter.ts (4)

30-56: LGTM! Clean type extensions.

The PromptContext interface is properly extended with inputTypeOverride, and imports follow coding guidelines with type-only imports.


150-175: LGTM! Context properly initialized.

The valuePromptContext is correctly computed from the input string before prompting, ensuring the input type override is available when needed. The existing VALUE injection preservation logic is maintained.


177-204: LGTM! Context extraction properly implemented.

The getValuePromptContext method correctly parses anonymous VALUE options and accumulates context for prompting. The defensive checks ensure context fields are only set when valid values are present.

Note: The static analysis warning about RegExp construction is a false positive—NAME_VALUE_REGEX is a constant defined in ../constants, not user input.


343-348: LGTM! Input type override properly threaded through variable prompts.

The inputTypeOverride from the parsed token is correctly passed to promptForVariable, enabling per-token multiline behavior for VALUE variables.


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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/preflight/RequirementCollector.ts (1)

159-171: Consider extracting the repeated input-type resolution logic.

The pattern for computing baseInputType appears three times in this file (here, in promptForValue, and in promptForVariable). Extracting it to a private helper would improve maintainability.

🔎 Proposed helper extraction
+	private resolveBaseInputType(
+		inputType: "multiline" | undefined,
+	): "textarea" | "text" {
+		return inputType === "multiline" ||
+			this.plugin.settings.inputPrompt === "multi-line"
+			? "textarea"
+			: "text";
+	}
+
 	private scanVariableTokens(input: string) {
 		// ... existing code ...
-		const baseInputType =
-			parsed.inputType === "multiline" ||
-			this.plugin.settings.inputPrompt === "multi-line"
-				? "textarea"
-				: "text";
+		const baseInputType = this.resolveBaseInputType(parsed.inputType);
src/utils/valueSyntax.ts (1)

170-193: Use the logger utilities instead of console.warn.

Per coding guidelines for src/**/*.{ts,tsx}, logging should be routed through the logger utilities for consistent output. The console.warn calls here should use the project's logging infrastructure.

🔎 Proposed fix
+import { log } from "../logger/logManager";
+
 function resolveInputType(
 	rawType: string | undefined,
 	{
 		tokenDisplay,
 		hasOptions,
 		allowCustomInput,
 	}: { tokenDisplay: string; hasOptions: boolean; allowCustomInput: boolean },
 ): ValueInputType | undefined {
 	if (!rawType) return undefined;
 	const normalized = rawType.trim().toLowerCase();
 	if (normalized !== "multiline") {
-		console.warn(
+		log.logWarning(
 			`QuickAdd: Unsupported VALUE type "${rawType}" in token "${tokenDisplay}". Supported types: multiline.`,
 		);
 		return undefined;
 	}
 	if (hasOptions || allowCustomInput) {
-		console.warn(
+		log.logWarning(
 			`QuickAdd: Ignoring type:multiline for option-list VALUE token "${tokenDisplay}".`,
 		);
 		return undefined;
 	}
 	return "multiline";
 }

Based on coding guidelines, route logging through the logger utilities.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 36d43ba and 8a9c481.

📒 Files selected for processing (12)
  • docs/docs/Advanced/onePageInputs.md
  • docs/docs/FormatSyntax.md
  • src/constants.ts
  • src/formatters/completeFormatter.ts
  • src/formatters/formatter.ts
  • src/gui/InputPrompt.test.ts
  • src/gui/InputPrompt.ts
  • src/preflight/OnePageInputModal.ts
  • src/preflight/RequirementCollector.test.ts
  • src/preflight/RequirementCollector.ts
  • src/utils/valueSyntax.test.ts
  • src/utils/valueSyntax.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,mts,mjs,js,json}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,mts,mjs,js,json}: Use tab indentation with width 2 in TypeScript and configuration files (enforced by Biome).
Follow an 80-character line guide (enforced by Biome).

Files:

  • src/preflight/OnePageInputModal.ts
  • src/gui/InputPrompt.test.ts
  • src/formatters/completeFormatter.ts
  • src/gui/InputPrompt.ts
  • src/constants.ts
  • src/utils/valueSyntax.test.ts
  • src/formatters/formatter.ts
  • src/utils/valueSyntax.ts
  • src/preflight/RequirementCollector.test.ts
  • src/preflight/RequirementCollector.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use camelCase for variables and functions in TypeScript.
Prefer type-only imports in TypeScript.

Files:

  • src/preflight/OnePageInputModal.ts
  • src/gui/InputPrompt.test.ts
  • src/formatters/completeFormatter.ts
  • src/gui/InputPrompt.ts
  • src/constants.ts
  • src/utils/valueSyntax.test.ts
  • src/formatters/formatter.ts
  • src/utils/valueSyntax.ts
  • src/preflight/RequirementCollector.test.ts
  • src/preflight/RequirementCollector.ts
**/*.{ts,tsx,svelte}

📄 CodeRabbit inference engine (AGENTS.md)

Use PascalCase for classes and Svelte components.

Files:

  • src/preflight/OnePageInputModal.ts
  • src/gui/InputPrompt.test.ts
  • src/formatters/completeFormatter.ts
  • src/gui/InputPrompt.ts
  • src/constants.ts
  • src/utils/valueSyntax.test.ts
  • src/formatters/formatter.ts
  • src/utils/valueSyntax.ts
  • src/preflight/RequirementCollector.test.ts
  • src/preflight/RequirementCollector.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Route logging through the logger utilities for consistent output.

Files:

  • src/preflight/OnePageInputModal.ts
  • src/gui/InputPrompt.test.ts
  • src/formatters/completeFormatter.ts
  • src/gui/InputPrompt.ts
  • src/constants.ts
  • src/utils/valueSyntax.test.ts
  • src/formatters/formatter.ts
  • src/utils/valueSyntax.ts
  • src/preflight/RequirementCollector.test.ts
  • src/preflight/RequirementCollector.ts
src/{engine,services,utils}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Structure production code so Obsidian dependencies are injected behind interfaces to enable unit testing without loading real Obsidian modules.

Files:

  • src/utils/valueSyntax.test.ts
  • src/utils/valueSyntax.ts
🧠 Learnings (1)
📚 Learning: 2025-12-21T07:54:34.863Z
Learnt from: CR
Repo: chhoumann/quickadd PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T07:54:34.863Z
Learning: Applies to tests/**/*.{ts,tsx} : Unit tests should target pure logic and swap in adapters or use `tests/obsidian-stub.ts` for Obsidian dependencies.

Applied to files:

  • src/gui/InputPrompt.test.ts
🧬 Code graph analysis (6)
src/gui/InputPrompt.test.ts (3)
src/gui/InputPrompt.ts (1)
  • InputPrompt (6-17)
src/gui/GenericWideInputPrompt/GenericWideInputPrompt.ts (1)
  • GenericWideInputPrompt (7-235)
src/gui/GenericInputPrompt/GenericInputPrompt.ts (1)
  • GenericInputPrompt (7-236)
src/formatters/completeFormatter.ts (2)
src/gui/InputPrompt.ts (1)
  • InputPrompt (6-17)
docs/static/scripts/userScriptExample.js (1)
  • description (141-145)
src/gui/InputPrompt.ts (2)
src/utils/valueSyntax.ts (1)
  • ValueInputType (4-4)
src/gui/GenericWideInputPrompt/GenericWideInputPrompt.ts (1)
  • GenericWideInputPrompt (7-235)
src/utils/valueSyntax.test.ts (1)
src/utils/valueSyntax.ts (2)
  • parseValueToken (195-237)
  • parseAnonymousValueOptions (239-276)
src/formatters/formatter.ts (2)
src/utils/valueSyntax.ts (2)
  • ValueInputType (4-4)
  • parseAnonymousValueOptions (239-276)
src/constants.ts (1)
  • NAME_VALUE_REGEX (80-82)
src/preflight/RequirementCollector.test.ts (1)
src/preflight/RequirementCollector.ts (1)
  • RequirementCollector (43-335)
🪛 ast-grep (0.40.3)
src/formatters/formatter.ts

[warning] 176-176: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(NAME_VALUE_REGEX.source, "gi")
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🔇 Additional comments (26)
docs/docs/FormatSyntax.md (2)

16-16: Documentation is clear and comprehensive.

The new VALUE token option is well-documented with appropriate constraints and usage notes. The explanation about shorthand defaults being ignored when |type: is present is particularly helpful for avoiding confusion.


31-38: Good practical example demonstrating mixed input types.

The example clearly shows how to combine single-line and multi-line inputs in the same template, which is helpful for users.

docs/docs/Advanced/onePageInputs.md (1)

21-21: LGTM!

The documentation addition is concise and accurately describes the textarea rendering behavior for multiline VALUE tokens in the one-page modal.

src/preflight/OnePageInputModal.ts (2)

407-416: LGTM!

The type-aware value escaping logic is well-implemented. Creating a Map for requirement lookup is efficient, and the conditional escaping for textarea inputs is correctly applied.


421-423: LGTM!

The backslash escaping implementation is straightforward and correct, consistent with the pattern used elsewhere in the codebase.

src/constants.ts (1)

80-82: LGTM!

The regex update correctly supports optional inline filters while excluding colon-based variable forms. The negative lookahead (?!:) and optional filter group (?:\|[^\n\r}]*)? are well-constructed.

src/preflight/RequirementCollector.test.ts (4)

10-17: Good test helper improvement.

The configurable makePlugin helper enables cleaner testing of different settings configurations while ensuring consistent default initialization.


77-85: LGTM!

The test correctly verifies that explicit type:multiline overrides the global single-line setting, which is core to the feature.


87-96: LGTM!

The test provides good coverage for unnamed VALUE tokens with multiline type, including verification that labels become descriptions for unnamed tokens.


98-106: LGTM!

The test confirms that global multiline settings continue to work when no explicit type is specified, ensuring backward compatibility.

src/gui/InputPrompt.test.ts (3)

1-13: LGTM!

The test setup properly mocks dependencies to avoid Obsidian loading while maintaining the necessary interfaces for testing. This follows the project's testing patterns.

Based on learnings, unit tests should use stubs for Obsidian dependencies.


15-25: LGTM!

The test correctly verifies that explicit inputType parameter takes precedence over global settings, which is essential for per-token control.


27-39: LGTM!

The tests provide complete coverage of the factory's decision logic: explicit override, global multiline fallback, and global single-line fallback.

src/utils/valueSyntax.test.ts (5)

1-1: Good test hygiene with afterEach cleanup.

Adding afterEach to restore mocks ensures test isolation and prevents mock leakage between test cases.

Also applies to: 10-12


51-59: LGTM!

The test verifies complete multiline parsing with all option types, ensuring the parser correctly extracts variable name, input type, label, and default value.


61-72: LGTM!

These tests verify important edge cases: shorthand default handling when explicit type is present (consistent with documentation), and validation warnings for unknown types.


74-79: LGTM!

The test correctly verifies that type:multiline is rejected for option lists (comma-separated values), with appropriate warnings, as documented in the constraints.


82-101: LGTM!

The tests provide appropriate coverage for anonymous VALUE token parsing, including happy path multiline handling and validation for unknown types.

src/formatters/completeFormatter.ts (2)

177-199: LGTM!

The changes properly integrate inputType throughout the value prompting flow, and consistently pass defaultValue and description to both prompt variants. This enables the per-token multiline control while maintaining backward compatibility.


228-228: LGTM!

The change enables inputType propagation for variable prompts, maintaining consistency with the value prompt implementation and completing the feature integration.

src/gui/InputPrompt.ts (1)

4-14: LGTM! Clean implementation of per-token multiline override.

The type-only import follows coding guidelines, and the early-return pattern for inputType === "multiline" correctly prioritizes explicit per-token configuration over the global plugin setting. The logic flow is clear and maintains backward compatibility.

src/preflight/RequirementCollector.ts (1)

195-211: LGTM! Correct propagation of description and defaultValue.

The promptForValue method now correctly derives the input type from valuePromptContext?.inputType and propagates description and defaultValue fields. This enables the one-page input modal to display richer context for anonymous VALUE tokens.

src/utils/valueSyntax.ts (1)

239-275: LGTM! Well-structured anonymous value options parser.

The parseAnonymousValueOptions function correctly handles edge cases (empty input, leading pipe normalization) and properly delegates to parseOptions and resolveInputType. The return type is appropriately narrow.

src/formatters/formatter.ts (3)

66-72: LGTM! Correct handling of intentional empty string values.

The updated hasConcreteVariable logic correctly distinguishes between "no value set" (undefined/null) and "intentionally empty value" (""). The docstring clarifies the intent well.


176-203: LGTM! The static analysis warning is a false positive.

The NAME_VALUE_REGEX is a compile-time constant from src/constants.ts, not user-controlled input. The new RegExp(NAME_VALUE_REGEX.source, "gi") pattern is safe and commonly used to add flags to an existing regex. The getValuePromptContext method correctly extracts and merges context from anonymous VALUE tokens.


328-341: LGTM! Correct propagation of inputType to variable prompts.

The inputType from parsed value tokens is now correctly passed through to promptForVariable, enabling subclasses like CompleteFormatter to select the appropriate input prompt type.

@chhoumann chhoumann merged commit 98fa7db into master Dec 23, 2025
3 of 4 checks passed
@chhoumann chhoumann deleted the 339 branch December 23, 2025 16:19
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] Toggle multiline input per capture command.

2 participants