Skip to content

feat(format): add case pipe for VALUE/NAME#1103

Merged
chhoumann merged 5 commits intomasterfrom
codex/case-transform
Feb 6, 2026
Merged

feat(format): add case pipe for VALUE/NAME#1103
chhoumann merged 5 commits intomasterfrom
codex/case-transform

Conversation

@chhoumann
Copy link
Owner

@chhoumann chhoumann commented Feb 6, 2026

Adds a new case:<style> pipe option to QuickAdd format syntax variables so values can be transformed inline (e.g. {{VALUE:title|case:kebab}} -> my-new-blog).

Supported styles: kebab, snake, camel, pascal, title, lower, upper, slug.

Behavior:

  • Applied after the value resolves (prompt/default/reuse)
  • Does not mutate stored variable values
  • Unknown styles are ignored (pass-through)
  • Smart casing for acronyms/brand tokens (e.g. My API Key -> myAPIKey, iOS App -> iOSApp)

UI:

  • Autocomplete for |case: styles in the format syntax suggester.

Docs + tests included.

Closes #90


Open with Devin

Summary by CodeRabbit

  • New Features

    • Value casing via |case: now supports slug and per-variable case styles; suggestions appear while typing.
    • Multi-line input forcing (|type:multiline) and a |custom option to allow free input alongside choices.
  • Documentation

    • Format syntax docs updated to show keyed options (label, default, type, case) and new transformation/combination rules.
  • Tests

    • Added tests covering case transformations, suggestions, parsing, and related behaviors.

Adds "case:<style>" pipe option for {{VALUE}}/{{NAME}}/{{VALUE:<var>}} to transform resolved values (kebab/snake/camel/pascal/title/lower/upper) at render time without mutating stored variables.

Refs #90
@vercel
Copy link

vercel bot commented Feb 6, 2026

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

Project Deployment Actions Updated (UTC)
quickadd Ready Ready Preview Feb 6, 2026 10:31pm

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

Adds per-token case transformation support for VALUE and NAME tokens via a new |case: option (styles: kebab, snake, camel, pascal, title, lower, upper, slug). Implements a transform utility, parses case in value syntax, applies transformations in the formatter, and adds tests and suggester support.

Changes

Cohort / File(s) Summary
Docs
docs/docs/FormatSyntax.md
Updated syntax docs to require keyed options (e.g., `
Case transform util & tests
src/utils/caseTransform.ts, src/utils/caseTransform.test.ts
New transformCase(input, style) and CaseStyle type supporting kebab, snake, camel, pascal, title, lower, upper, slug; Unicode-aware tokenization, acronym/brand handling, slug reserved-name handling; tests covering edge cases.
Value syntax parsing & tests
src/utils/valueSyntax.ts, src/utils/valueSyntax.test.ts
Parse and expose new caseStyle option in VALUE_OPTION_KEYS, ParsedValueToken, ParsedOptions; anonymous value parsing updated; tests added for case: extraction.
Formatter integration & tests
src/formatters/formatter.ts, src/formatters/formatter-case.test.ts
Formatter now reads caseStyle from parsed tokens and applies transformCase() during anonymous value injection, variable replacement, and YAML collection; comprehensive unit tests added for per-token casing behaviors.
Suggester & suggester tests
src/gui/suggesters/formatSyntaxSuggester.ts, src/gui/suggesters/formatSyntaxSuggester.case.test.ts
Suggester now recognizes `
Constants
src/constants.ts
Added VALUE_CASE_SYNTAX and VARIABLE_CASE_SYNTAX constants and integrated into existing syntax lists.
Pipe parsing helpers
src/utils/pipeSyntax.ts
New helpers splitPipeParts, stripLeadingPipe, and parsePipeKeyValue to parse pipe-delimited key:value segments reliably.
Field suggestion parser
src/utils/FieldSuggestionParser.ts
Switched to pipe helpers; extended FieldFilter with new keys (inline, defaultValue, defaultEmpty, defaultAlways, caseSensitive, excludeFolders/Tags/Files) and updated parsing to use key/value parsing.
Requirement tests
src/preflight/RequirementCollector.test.ts
Added tests ensuring case: is not treated as a legacy default for named/unnamed VALUE tokens.
Test utilities
tests/obsidian-stub.ts
Added a no-op immediate debounce helper used by tests.

Sequence Diagram

sequenceDiagram
    participant User
    participant Formatter
    participant Parser as ValueSyntaxParser
    participant Transformer as transformCase
    participant Output

    User->>Formatter: Provide template with {{VALUE:...|case:kebab}}
    Formatter->>Parser: parseValueToken(token)
    Parser-->>Formatter: ParsedValueToken { valueName?, options..., caseStyle: "kebab" }
    Formatter->>Formatter: Resolve raw value (prompt/vars/default)
    Formatter->>Transformer: transformCase(rawValue, "kebab")
    Transformer-->>Formatter: transformedValue
    Formatter->>Output: Inject transformedValue into generated output
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

released

Poem

🐇 With whiskers twitching, I hop through the code,
I stitch words to kebab, snake, camel on the road.
From TITLE to slug, each token I tend,
A rabbit of cases — transform and send! 🎩✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% 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 summarizes the main change: adding a case pipe option for VALUE/NAME tokens in the format syntax.
Linked Issues check ✅ Passed The PR implements inline value transformation for VALUE/NAME tokens with case styles (kebab, snake, camel, pascal, title, lower, upper, slug), directly addressing issue #90's request for space-to-character replacement for filename-friendly strings.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the case pipe feature. Helper utilities (pipeSyntax, caseTransform), test infrastructure, documentation, and UI suggestions are all supporting the core objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 codex/case-transform

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.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 6, 2026

Deploying quickadd with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1bdb748
Status: ✅  Deploy successful!
Preview URL: https://cb4522a0.quickadd.pages.dev
Branch Preview URL: https://codex-case-transform.quickadd.pages.dev

View logs

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@chhoumann chhoumann merged commit 1a962c2 into master Feb 6, 2026
5 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 8, 2026
# [2.11.0](2.10.0...2.11.0) (2026-02-08)

### Bug Fixes

* add newline when appending tasks ([#1102](#1102)) ([a4b4e4a](a4b4e4a))
* clarify split direction labels to match actual behavior ([#1089](#1089)) ([ea97045](ea97045)), closes [#1081](#1081)
* correct end-of-section line detection ([#1096](#1096)) ([0eeedb3](0eeedb3)), closes [#593](#593)
* **docs:** explain how to add user scripts to macros ([c6e2448](c6e2448))
* encode spaces in advanced uri docs ([0c24cd0](0c24cd0))
* handle alias frontmatter case and commas ([cc6aec6](cc6aec6))
* improve capture target resolution ([1bd7520](1bd7520))
* improve choice rename UX ([bccc331](bccc331)), closes [#683](#683)
* **settings:** hide .md extension in settings suggesters ([#1104](#1104)) ([2e6056e](2e6056e)), closes [#102](#102)

### Features

* **format:** add case transforms for VALUE/NAME ([#1103](#1103)) ([1a962c2](1a962c2)), closes [#90](#90)
@github-actions
Copy link

github-actions bot commented Feb 8, 2026

🎉 This PR is included in version 2.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

🚀 Release has been published: v2.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] filename replace spaces with char '-'

1 participant