Repository navigation
ENG-2323 Warn about unsupported placeholders in Obsidian node formats - #1536
Open
trangdoan982 wants to merge 2 commits into
Open
trangdoan982 wants to merge 2 commits into
trangdoan982 wants to merge 2 commits into
Conversation
The Format field now blocks formats with placeholders other than {content},
using the same placeholder rule as decorateTitle. Also removes the unused
apps/obsidian/src/utils/validateNodeFormat.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 01M4H5SWF8GGWS6A6NNMTMCZ0Y
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M4H6BVH4WB0P9JDH4MNKJ9F4
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reviewer brief
{content}. The error names each unsupported placeholder and blocks saving, the same way the double-bracket error does.FORMAT_PLACEHOLDERandCONTENT_PLACEHOLDERfrompackages/database/src/lib/decorateTitle.ts, so settings rejects exactly the formatsdecorateTitlecan't build a title from (ENG-2346).EVD - {content} - {Source}can't save edits to any field until its format is fixed. The error shows on the Format field. This is intended. Imported node types aren't affected, because their settings form is read-only.Where the new check sits in
validateNodeFormat(apps/obsidian/src/utils/validateNodeType.ts):flowchart TD A["NodeTypeSettings.tsx<br/>Format input change or save"] --> B["validateNodeFormat(format)"] B --> C{"empty or has [[ ]]?"} C -- yes --> X["error, save blocked"] C -- no --> D{"includes {content}?"} D -- no --> X D -- yes --> E{"NEW: other {placeholder}s?<br/>FORMAT_PLACEHOLDER from decorateTitle"} E -- yes --> X E -- no --> F["invalid filename chars, uniqueness"] --> G["save"]Verification
pnpm ci:validatepasses on head29191dafwith no cached turbo tasks.Live Obsidian 1.13.7, driven over CDP in Settings > Node types (DOM input and focusout events in the Settings window):
{Source}EVD2 - {content} - {Source}Format contains unsupported placeholder: {Source}. Only {content} is supported., not saved{Author}: {content}Format contains unsupported placeholder: {Author}. Only {content} is supported., not saved{Source} - {content} - {Author}Format contains unsupported placeholders: {Source}, {Author}. Only {content} is supported., not savedVRF - {content}{content}VRF - {Source}{content}errorFormat must include the placeholder "{content}", not savedUser Pilotformat set toUP - {content} - {Source}in memory, then openedTests added in
apps/obsidian/src/utils/__tests__/validateNodeType.test.ts. Rerun withpnpm -C apps/obsidian test:unit.Not verified: a real Roam schema import with
{Source}. The imported case set the format in memory, because import doesn't callvalidateNodeFormatand no imported type in the test vault has an extra placeholder.Loom video
pending
Scope check
$scope-checkagainst ENG-2323 and the final diff.Done When:apps/obsidian/src/utils/validateNodeFormat.ts, which nothing imports.Standards check
$dg-pr-adherence-checkagainst the final diff and PR metadata.Local delegated full review
$dg-delegated-full-reviewwhen no other full-review workflow is available.No findings. The reviewer pointed out the blocking behaviour for old formats, which is listed under Risk.
🤖 Generated with Claude Code