Skip to content

[Obsidian review blockers] - Step 1: Use the vault config directory - #2787

Merged
logancyang merged 1 commit into
masterfrom
codex/issue-285-05-settings-review
Aug 9, 2026
Merged

[Obsidian review blockers] - Step 1: Use the vault config directory#2787
logancyang merged 1 commit into
masterfrom
codex/issue-285-05-settings-review

Conversation

@logancyang

@logancyang logancyang commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Relates to logancyang/obsidian-copilot-preview#285

Why

The Copilot root validator assumes the conventional Obsidian configuration-folder name. Vaults can use a different configuration directory, so the current check can reject a harmless folder while allowing a newly selected Copilot root to overlap the real configuration directory.

What

New Copilot-root selections are validated against the active vault configuration directory. Existing persisted roots remain addressable during settings loading and are not reset, moved, or migrated.

Non goal

  • Add declarative or searchable settings; that warning is deferred because it changes the settings rendering lifecycle.
  • Redesign the settings UI or change labels, defaults, and storage formats.
  • Move, rename, or delete existing Copilot data.

Screenshot

Not applicable — this PR does not change rendered settings UI.

Risk

High

Criterion Status Reason
No behavior change, or a cosmetic/copy/docs/config change visible where it renders, or deterministic tests cover the changed behavior Deterministic validator and settings-component tests cover active config-directory rejection and legacy-root preservation
A defect would fail CI or be obvious on first use The changed validation branches are exercised by unit tests
A revert fully restores prior state, including persisted data The PR performs no data migration or irreversible write
No auth, permissions, secrets, or input-handling surface changes Copilot-root input validation changes
No public API, plugin API, message, or on-disk contract changes Persisted values and storage formats are unchanged
No core-path concurrency, async-lifecycle, or state-machine changes Validation remains synchronous
No hot-path behavior lacks deterministic coverage Both UI validation and defensive apply-time validation are covered
No new dependency Dependency manifests are unchanged
Human-only behavior stays in one feature area and surfaces quickly Rejection appears immediately when applying an invalid root

Review: inspect validateCopilotFolder in src/settings/model.ts, applyCopilotRootChange in src/settings/copilotRootChange.ts, and applyFolderChange in src/settings/v2/components/BasicSettings.tsx; then follow Verification steps 1–3.

Verification

  1. Open Copilot Basic settings in a vault with a custom Obsidian configuration directory.
  2. Enter that configuration directory, or one of its descendants, as the Copilot folder and apply it. Confirm that the value is rejected before the confirmation dialog opens.
  3. Restart with an existing syntactically valid custom Copilot root. Confirm that the stored root remains unchanged and its existing data remains available.

@logancyang
logancyang force-pushed the codex/issue-285-05-settings-review branch from a797282 to 06fa64b Compare August 8, 2026 23:34
@logancyang
logancyang marked this pull request as ready for review August 8, 2026 23:40

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06fa64b4d0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/settings/SettingsPage.tsx Outdated
@logancyang

Copy link
Copy Markdown
Owner Author

Conservative-scope risk note before merge:

This layer currently does more than the Obsidian review error requires. In particular, load-time validation can silently replace an already-persisted copilotFolder with the default, making existing Copilot data appear missing, and the declarative settings host relies on layout-neutralizing CSS that does not arrive until a later PR.

I am revising this PR so it is independently safe:

  • preserve every existing persisted setting and remove load-time folder coercion;
  • use the runtime vault config directory only when validating a newly entered root;
  • keep the minimal searchable-settings adapter required by Obsidian;
  • include the adapter neutral host CSS in this same PR;
  • make no settings redesign, default, storage, migration, or visible layout change.

Errors remain the priority. Warning-only cleanup will be left alone when it adds behavior or UI risk.

@logancyang
logancyang force-pushed the codex/issue-285-05-settings-review branch from 06fa64b to d58fcb1 Compare August 9, 2026 00:42
@logancyang logancyang changed the title [Obsidian review blockers] - Step 5: Integrate searchable settings [Obsidian review blockers] - Step 5: Use the vault config directory Aug 9, 2026
@logancyang
logancyang force-pushed the codex/issue-285-05-settings-review branch from d58fcb1 to a1be02a Compare August 9, 2026 01:18
@logancyang logancyang changed the title [Obsidian review blockers] - Step 5: Use the vault config directory [Obsidian review blockers] - Step 1: Use the vault config directory Aug 9, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a1be02a7a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/settings/model.ts Outdated
@logancyang
logancyang changed the base branch from codex/issue-285-04-async-boundaries to master August 9, 2026 01:26
@logancyang

Copy link
Copy Markdown
Owner Author

Conservative risk disposition

Risk: High, but retained because it addresses an error-level review finding.

This PR changes user input validation, so it is the only surviving layer that can intentionally change behavior. It has been reduced to validating a newly selected Copilot root against the vault's actual configuration directory. The warning-only searchable-settings implementation was removed; persisted roots, storage formats, labels, and rendered settings UI are unchanged.

Recommendation: keep this as Step 1 with focused validation tests and review it independently before the type/lint and CI layers.

@logancyang
logancyang force-pushed the codex/issue-285-05-settings-review branch from a1be02a to 9f650b5 Compare August 9, 2026 02:41
@logancyang
logancyang merged commit f8f4a03 into master Aug 9, 2026
2 checks passed
@logancyang
logancyang deleted the codex/issue-285-05-settings-review branch August 9, 2026 20:53
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