Skip to content

0.17.0 — Multiple conditions per rule (any/all)

Choose a tag to compare

@diegoeis diegoeis released this 17 May 00:47
· 62 commits to main since this release

Each rule now supports a flat list of conditions combined with Match any / Match all of the following, inspired by Zotero. Replaces the old workaround of using temporary properties to simulate AND/OR.

New Features

  • Multiple conditions per rule (any/all): each rule now supports a flat list of conditions and a Match any of the following / Match all of the following selector at the top of the IF block. Tracked in FRD-001 v2.0.
  • + Add condition button appended to the IF block — arbitrary number of conditions per rule, each keeping the existing layout (PROPERTY / FIRST_LEVEL_HEADING + operator + value).
  • Per-condition remove (×): each condition gets a remove button when more than one is present. When the rule is back to a single condition, the match dropdown auto-hides.

Migration

  • Automatic, one-time migration from the legacy single-condition shape to the new { match, conditions: [...] } shape. Migration version bumps from 2 to 3 inside _migrateRules() and is idempotent.
  • All legacy rules default to match: "any". Because there is exactly one condition, behavior is bit-for-bit identical to v0.16.3 until the user adds a second condition.
  • data.backup.json is written next to data.json in the plugin folder before the migration writes anything, so users can recover the pre-v0.17.0 settings by copying it back if needed.
  • Downgrade is not supported after the first v0.17.0 load. Older plugin versions don't understand conditions[] and will silently ignore the new rules.

Bug Fix Bundled

  • applyRulesToFrontmatter was shallow-copying frontmatter ({...currentFrontmatter}), which preserved nested array references shared with Obsidian's metadataCache. Mutations like newFm.tags.push(...) polluted the cache permanently and the next run would see the value as "already applied" and skip the write. Replaced with a deep clone (JSON round-trip).

UI Polish

  • Buttons migrated to the official ButtonComponent API with .setCta() (Add rule, + Add condition, + Add action), .setWarning() (Remove), or default styling (Run this rule).
  • Match selector migrated to DropdownComponent.
  • IF header rebuilt to mirror the THEN header structure, with the match dropdown flex-aligned to the right.
  • Condition rows now reuse the same visual treatment as action rows (.conditional-then-action).

CSS

  • Dropped all legacy .eis-btn* rules, removed orphan .conditional-remove-action, removed --cp-red-color.
  • Scoped .setting-item-name under #eis-cp-plugin so it stops leaking into other plugins' settings tabs.
  • Deduplicated .conditional-rules-header.

Compatibility

  • Minimum Obsidian version: 1.5.0 (unchanged).