Skip to content

ENG-2323 Warn about unsupported placeholders in Obsidian node formats - #1536

Open
trangdoan982 wants to merge 2 commits into
mainfrom
eng-2323-warn-about-unsupported-placeholders-in-obsidian-node-formats
Open

trangdoan982 wants to merge 2 commits into
mainfrom
eng-2323-warn-about-unsupported-placeholders-in-obsidian-node-formats

Conversation

@trangdoan982

@trangdoan982 trangdoan982 commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Reviewer brief

  • Result: the Format field in Obsidian node type settings now rejects any placeholder other than {content}. The error names each unsupported placeholder and blocks saving, the same way the double-bracket error does.
  • Review focus: this is a blocking error, not the warning the ticket title describes. "Warning" was the wrong word in the ticket. The check reuses FORMAT_PLACEHOLDER and CONTENT_PLACEHOLDER from packages/database/src/lib/decorateTitle.ts, so settings rejects exactly the formats decorateTitle can't build a title from (ENG-2346).
  • Risk or follow-up: a local node type saved before this change with a format like 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"]
Loading

Verification

pnpm ci:validate passes on head 29191daf with 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):

Scenario Input Expected Actual Pass
{Source} Add node type, format EVD2 - {content} - {Source} error, not saved Format contains unsupported placeholder: {Source}. Only {content} is supported., not saved yes
Arbitrary placeholder format {Author}: {content} error, not saved Format contains unsupported placeholder: {Author}. Only {content} is supported., not saved yes
Several placeholders format {Source} - {content} - {Author} error listing both, not saved Format contains unsupported placeholders: {Source}, {Author}. Only {content} is supported., not saved yes
Content only format VRF - {content} no error, saved no error, saved yes
Missing {content} format VRF - {Source} existing missing-{content} error Format must include the placeholder "{content}", not saved yes
Imported node type imported User Pilot format set to UP - {content} - {Source} in memory, then opened read-only, no error format input disabled, no error yes
Scenario Screenshot
Format with {Source}: blocking error Format with {Source}: blocking error
Format with {Author}: blocking error Format with {Author}: blocking error
Format with {Source} and {Author}: blocking error Format with {Source} and {Author}: blocking error
Content-only format: no error, saves Content-only format: no error, saves
No {content}: existing error No {content}: existing error
Imported type with {Source}: read-only, no error Imported type with {Source}: read-only, no error

Tests added in apps/obsidian/src/utils/__tests__/validateNodeType.test.ts. Rerun with pnpm -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 call validateNodeFormat and no imported type in the test vault has an extra placeholder.

Loom video

pending

Scope check

  • Ran $scope-check against ENG-2323 and the final diff.
  • Scope beyond Done When:
    1. The ticket asks for a warning. Unsupported placeholders are a blocking error instead, so a local node type saved earlier with such a format can't save edits until its format is fixed.
    2. Out of scope, small maintenance: deleted apps/obsidian/src/utils/validateNodeFormat.ts, which nothing imports.
  • Required now: (1) is ENG-2323 itself. "Warning" was the wrong word in the ticket, and blocking matches ENG-2346. (2) isn't required; it's a cheap cleanup next to the touched file.
  • Anyone affected or consulted: Yes, Trang.
  • Decision: Not documented. To be recorded in a Linear comment on ENG-2323 before merge.

Standards check

  • Ran $dg-pr-adherence-check against the final diff and PR metadata.

Local delegated full review

  • Ran a comprehensive review of the entire final diff in a subagent with a fresh context. Use $dg-delegated-full-review when 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


Devin Review

trangdoan982 and others added 2 commits October 9, 2026 16:31
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
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
discourse-graph Skipped Skipped Oct 9, 2026 8:45pm UTC

Request Review

@supabase

supabase Bot commented Oct 9, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@linear-code

linear-code Bot commented Oct 9, 2026

Copy link
Copy Markdown

ENG-2323

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

Copy link
Copy Markdown
Contributor

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 bugs or issues to report.

Devin Review

This branch was previously deployed

1 inactive deployment
Preview — 29191daf Deployed Oct 9, 2026 by vercel[bot]
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