Skip to content

feat(cli): daily notes folder and format in the settings chooser - #433

Merged
aliasunder merged 14 commits into
mainfrom
cli-daily-notes-settings
Aug 14, 2026
Merged

feat(cli): daily notes folder and format in the settings chooser#433
aliasunder merged 14 commits into
mainfrom
cli-daily-notes-settings

Conversation

@aliasunder

@aliasunder aliasunder commented Aug 13, 2026

Copy link
Copy Markdown
Owner

What this adds

DAILY_NOTES_FOLDER and DAILY_NOTES_FORMAT (shipped in v0.36.2, #427) could only be set by hand-editing .env. This surfaces them in the init/configure settings chooser, the same convenience tier as the memory folder.

Changes

  • New optionalText setting kind — the first chooser settings whose default is "unset" (the server reads the vault's own .obsidian/daily-notes.json). The existing folder kind requires a concrete defaultValue and pre-fills it, which is wrong here: accepting a pre-filled value would write an override that silently shadows the vault config. optionalText carries a question + placeholder and no default.
    • Blank when unset = skip — nothing is written (never an empty NAME= line), with a log line making the skip legible.
    • Blank when set keeps the current value (the prompt resolves an empty submit to its default), so blank never destroys an existing setting — consistent with the memory folder, which also can't be cleared via the chooser. Clearing stays a manual .env edit; the README's configure section now says so.
  • Two chooser entries inserted after Memory folder, offered in both modes: "Daily notes folder" and "Daily notes format" (question carries the YYYY-MM-DD token example; the shared placeholder says "blank = use your vault's daily notes settings"). The existing hint machinery shows "currently not set" / the current value with no code change.
  • No CLI-side validation beyond trim — deliberate. The server's folder validation also normalizes (a partial mirror would drift or silently rewrite input), the format's probe-render validation lives server-side, and the CLI-validation precedent (TZ via Intl, port range) is "a local authoritative validator with zero drift risk exists" — none does here. A bad value fail-fasts at boot with a named-env-var error, and the restart path already health-probes and points at logs.
  • askSettingValue widens to Promise<string | undefined>; the collection loop skips undefined. Module-private, single caller; the Prompts interface is untouched, so no test-stub churn.
  • Connect-message enumerations (local + remote) and the cli/README init/configure enumerations gain the pair.

The write path needed no changes: both vars already exist as commented template lines in the generated .env (drift-guarded against deploy/*/.env.example), so applyOptionalSettings' existing uncomment branch lands the chosen value. Both vars already flow through every step of the env-var checklist — this PR adds no var and touches nothing outside cli/.

Tests

  • Chooser arrays (local 6→8, remote 7→9) and hint expectations updated; new hint test for a set value.
  • New per-setting tests: blank-when-unset skips and writes nothing (asserting defaultValue: undefined was passed — the guard against pre-filling); blank-when-set keeps; typed value trimmed; whitespace-when-set doesn't clobber; mixed pick records only the typed setting.
  • New configure integration tests: a typed value lands by uncommenting the template line (not appending a duplicate); pick-then-blank falls through to the "No settings selected" early-out with the file byte-identical.
  • Mutation-verified: replacing the blank guard with the naive return answer fails 5 tests (the new blank-semantics tests plus the memory-folder empty-rejection test) for the intended reason.
  • npm run build (both cli tsconfigs) green, full suite 2535 tests passing, lint clean.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added optional daily notes folder and filename format settings to setup and configuration flows.
    • Daily notes settings now preserve existing values, support clearing unset values, and avoid unnecessary changes when left blank.
    • Configuration prompts now display clearer hints for available and unset options.
  • Bug Fixes

    • Updated no-op configuration feedback to consistently report: “No changes to apply.”
  • Documentation

    • Expanded setup and configuration guidance for daily notes settings, including environment-based reset instructions.

aliasunder and others added 2 commits August 13, 2026 16:49
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… README

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread cli/src/optional-settings.ts
@umm-actually

umm-actually Bot commented Aug 13, 2026

Copy link
Copy Markdown

umm-actually re-reviewed at 70bf15b

No new findings (2 tracked finding(s) across all runs).


umm-actually · deepseek/deepseek-v4-flash-0731

aliasunder and others added 4 commits August 13, 2026 17:03
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The placeholder field comment and function docstring restated
code-readable behavior; compressed to non-obvious constraints only.
The skip message hardcoded "daily notes" in a generic function —
generalized so future optionalText settings get an accurate log.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The "set value + typed different value" branch of askOptionalText and the
configure-level active-line replacement for daily notes were untested.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The type's JSDoc enumerated toggle, port, timezone, and choice but
omitted folder (pre-existing) and optionalText (new with this PR).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread cli/src/optional-settings.ts
@aliasunder

Copy link
Copy Markdown
Owner Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 37d58c96-9218-4af3-ab4f-a52a235c172a

📥 Commits

Reviewing files that changed from the base of the PR and between 1845ad1 and b7b3768.

📒 Files selected for processing (8)
  • cli/README.md
  • cli/src/__tests__/command-stubs.ts
  • cli/src/__tests__/configure.test.ts
  • cli/src/__tests__/init.test.ts
  • cli/src/__tests__/optional-settings.test.ts
  • cli/src/configure.ts
  • cli/src/messages.ts
  • cli/src/optional-settings.ts

📝 Walkthrough

Walkthrough

The CLI now supports daily-notes folder and format settings in initialization and configuration flows. Optional text prompts preserve blank or unchanged values without writing .env overrides. Tests and documentation cover the new behavior.

Changes

Daily notes settings

Layer / File(s) Summary
Optional text setting flow
cli/src/optional-settings.ts
Adds daily-notes folder and format prompts. Blank and unchanged responses do not create overrides.
CLI integration and guidance
cli/src/configure.ts, cli/src/messages.ts, cli/README.md, cli/src/__tests__/init.test.ts
Adds daily-notes settings to configuration messages, initialization prompts, and documentation. Updates the no-op message.
Prompt and configuration coverage
cli/src/__tests__/command-stubs.ts, cli/src/__tests__/optional-settings.test.ts, cli/src/__tests__/configure.test.ts
Tests placeholders, chooser hints, updates, blank input, retained values, and no-op behavior.

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

Mergeability Score: ⚪ Minimal · up to b7b37

The PR adds daily-notes settings to the CLI chooser with localized behavior changes, and no actionable merge-blocking risk remains after normal checks.

Possibly related PRs

Suggested labels: Review effort 2/5

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 daily notes folder and format options to the CLI settings chooser.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cli-daily-notes-settings

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.

@aliasunder

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

aliasunder and others added 3 commits August 13, 2026 19:40
…ings

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@aliasunder
aliasunder merged commit 955c2bd into main Aug 14, 2026
20 checks passed
@aliasunder
aliasunder deleted the cli-daily-notes-settings branch August 14, 2026 00:20
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.

1 participant