Critique your plugin #1 — Obsidian October 2024
Based on Obsidian's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Replace custom H1-based section headings with Obsidian’s standard setting-heading styling to match the app’s typography and spacing.
Briefing
Obligator’s settings UI needs to match Obsidian’s own design conventions, and the fastest wins come from small, concrete changes: removing redundant headings, using the API’s “setting heading” styling, and restructuring the page so related options sit together and appear only when they’re relevant. The critique zeroes in on how the settings tab currently feels “off” compared with the rest of Obsidian, then walks through a set of edits that bring the plugin into alignment—starting with the settings layout and then moving into the logic that decides what shows up.
The first round of fixes targets visual consistency. Obvious problems include large HTML H1 headings labeled “basic settings,” plus oversized “Archive” and “Advanced” headings created with H1 tags. The recommended approach is to remove redundant section titles entirely and replace custom headings with Obsidian’s standard setting-heading treatment via the API (using a “set heading” call rather than manually creating H1 elements). The critique also calls out naming redundancy—since the UI already lives inside the settings tab, repeating the word “settings” in labels wastes space.
Beyond styling, the settings page should behave intelligently. Two options—“initial heading” and “terminal heading”—are treated as always visible, even though they only make sense when a template file is configured. The suggested fix is to hide these settings unless the template path exists, by gating their rendering inside the display function behind a check for template path presence. The critique further notes that the UI must refresh when the template path changes: the code currently refreshes headings only when the path points to a file, but it should also re-render when the template is cleared or becomes invalid so the settings appear/disappear immediately.
Once the UI is cleaner, attention shifts to wording and toggle semantics in the “Advanced” section. Two toggles—“delete empty headings” and “don’t delete headings from template”—are both defaulted to on, but their phrasing creates cognitive friction because one toggle’s “on” means delete, while the other’s “on” means don’t delete. The critique recommends making toggle names affirmative so “on” consistently corresponds to the action being performed, either by renaming and inverting the toggle value or by changing the label to reflect the preserved behavior.
The review then moves from UI to code structure. The plugin class is relatively small, with most logic inside an onload routine that loads settings, defines a ribbon icon to open today’s daily note, and conditionally runs a “run obligator” function on startup. The critique suggests naming improvements (e.g., aligning the ribbon action name with what it actually opens) and highlights that validation is a strong point: the run function checks for missing note paths, verifies folders exist, and validates initial/terminal heading configuration.
Still, several improvements are proposed. Notices should include the plugin name to help users debug which plugin triggered them. For folder/file existence, newer Vault helpers (get file by path / get folder by path) can reduce type ambiguity. The code currently saves settings even when no changes occur, and it performs risky markdown parsing to confirm headings exist—an approach the critique flags as error-prone compared with using Obsidian’s metadata cache. Finally, there’s a feature request: open the daily note in a new tab when the ribbon is clicked with a modifier key. That would require passing a leaf type into getLeaf, derived from the click’s modifier state via keymap event handling, so behavior matches how users interact with Obsidian.
Overall, the critique frames plugin quality as a mix of UI conformity, correct reactive rendering, clear toggle semantics, and robust validation—plus small interaction upgrades that respect Obsidian’s navigation patterns.
Cornell Notes
Obligator’s settings and behavior can be improved with targeted changes that bring it in line with Obsidian’s UI standards and make configuration safer. The critique recommends removing redundant and oversized headings (especially H1-based ones) and using Obsidian’s setting-heading API styling. It also argues that “initial heading” and “terminal heading” should be hidden unless a template file path exists, with the settings page re-rendering whenever the template path changes. In the code, validation is a strength, but notices should identify the plugin, settings shouldn’t be saved when nothing changed, and markdown heading checks should avoid brittle parsing in favor of metadata cache. A final enhancement would open the daily note in a new tab when modifier-clicking the ribbon icon.
What specific UI changes make Obsidian plugin settings look and feel native?
Why should “initial heading” and “terminal heading” be hidden until a template file is configured?
What reactive behavior is required when the template path changes?
How do toggle names affect user understanding in the “Advanced” section?
What are the main code-quality concerns raised inside run obligator?
How could the ribbon click be enhanced to open the daily note in a new tab?
Review Questions
- Which settings UI elements should be removed or replaced to match Obsidian’s settings-tab conventions, and what API mechanism is used for the replacement?
- What conditions should control whether “initial heading” and “terminal heading” settings are rendered, and what must happen when the template path is cleared?
- Why is direct markdown parsing for heading validation considered risky, and what Obsidian feature is suggested as a more reliable alternative?
Key Points
- 1
Replace custom H1-based section headings with Obsidian’s standard setting-heading styling to match the app’s typography and spacing.
- 2
Remove redundant labels like “basic settings” and avoid repeating “settings” inside the settings tab UI.
- 3
Render “initial heading” and “terminal heading” only when a template path exists, and re-render immediately when the template path changes or is cleared.
- 4
Fix confusing toggle semantics by rewriting toggle names so the “on” state consistently corresponds to the described action, or invert the stored value to match the new wording.
- 5
Add plugin-identifying context to user notices so debugging doesn’t require guessing which plugin triggered them.
- 6
Avoid saving settings when validation doesn’t actually modify any values.
- 7
Replace brittle markdown heading parsing with metadata cache-based validation, and consider modifier-aware ribbon behavior to open notes in new tabs.