Skip to content

Releases

1.0.6

Choose a tag to compare

@github-actions github-actions released this 16 Nov 19:13
8ceda16

Fixes the caret bug reported on desktop and mobile.

What was wrong

The chevron is a CodeMirror inline widget sitting at the end of the heading line. Because it had real inline width, a caret at that same position was drawn on the far side of the icon: typing landed at the end of the heading while the cursor appeared somewhere else. A second problem made it worse — any click at or past the end of the heading text folded the section, stealing the natural "click after the last word to keep typing" gesture.

What changed

  • The chevron no longer takes layout space. It is now a zero-width box with the icon positioned inside it, so the caret always lands at the true end of the text. The icon stays visible the whole time — nothing is hidden while you edit.
  • The end of a heading stays editable. Clicks in the small gap after the last character place the caret; the icon itself still folds, as does the empty area further right.
  • Folding is untouched otherwise: same fold state, same Outline sync, same settings.

Under the hood

  • Editor logic moved to src/editor.ts, free of any obsidian import, with Obsidian's createSpan injected. Same shipped code, now testable outside Obsidian.
  • A behaviour harness (test/) mounts that extension in plain CodeMirror 6 against the shipped styles.css and asserts 14 behaviours — caret position relative to the icon, click zones, fold toggling, disabled levels, settings rebuilds.
  • npm test builds the harness and runs it headless; .github/workflows/ci.yml gates every pull request on it.

Requires Obsidian 1.5.0 or later.

1.0.5

Choose a tag to compare

@github-actions github-actions released this 16 Nov 18:33

Fixes a caret bug in Live Preview and Source, on desktop and mobile. Reading view is unaffected.

What was wrong. The chevron is a CodeMirror inline widget at the end of the heading line. With the caret at that same position, CodeMirror has to draw the caret on one side of the widget — and because the widget is attached with side: -1 (which keeps it on this line instead of jumping to the next), the caret was drawn past the icon while the real insertion point stayed at the end of the text. Typing landed in the right place, but the cursor pointed somewhere else.

A second problem made it worse: any click at or after the end of the heading text was treated as a fold click, so the natural gesture of clicking just after the last character to keep typing folded the section instead.

What changed

  • The widget is no longer rendered on a heading whose caret sits at its end, so there is nothing for the caret to be drawn on the wrong side of.
  • The click handler now measures the text's right edge and reserves a small strip after it for caret placement. Clicks further right, or on the chevron itself, still fold.
  • Decorations rebuild on selection changes, so the indicator appears and disappears as the caret moves in and out of the end of a heading.

Requires Obsidian 1.5.0 or later.

1.0.4

Choose a tag to compare

@github-actions github-actions released this 16 Nov 15:26

Restores the original SVG mask icons, which look sharper than the border-drawn ones shipped in 1.0.3.

The CSS lint warned that masks are only partially supported at Obsidian 1.4.5 — below this plugin's declared minimum of 1.5.0. -webkit-mask is fully supported in every Chromium that Obsidian 1.5.0 and later ships, so drawing the icons with borders traded visible quality for a warning about an unsupported baseline.

The :has() removal from 1.0.3 stays: that one was not version-dependent, and reading-view collapse state still comes from the section container's is-collapsed class.

Requires Obsidian 1.5.0 or later.

1.0.3

Choose a tag to compare

@github-actions github-actions released this 15 Nov 03:29

Addresses the two CSS lint findings from the community directory review. No JavaScript change; this release is styling only.

  • Removed :has(). Reading-view collapse state is now read from the is-collapsed class that Obsidian sets on the heading's section container, which is an ancestor of the heading — a plain descendant selector does the job. No broad selector invalidation.
  • Removed CSS masks. Both icons are now drawn without mask and without inline SVG data URIs: the chevron is two borders on a rotated box, and plus/minus is one or two linear-gradient layers. Both inherit currentColor, so themes still apply, and there is no dependency on a partially supported feature.

Behaviour, settings and defaults are unchanged. Requires Obsidian 1.5.0 or later.

1.0.2

Choose a tag to compare

@github-actions github-actions released this 15 Nov 02:58

Addresses the Obsidian community directory's source review.

  • No more injected CSS. The plugin used to build a stylesheet at runtime and append a <style> element, which the directory rejects. All styling now lives in styles.css, and the settings toggle classes on <body> (ah-h1…ah-h6, ah-icon-plus, ah-vis-hover). Popout windows are kept in sync through the window-open event, and the classes are removed on unload.
  • The CodeMirror widget now uses createSpan() instead of document.createElement().
  • getSettingDefinitions() implemented, so the settings appear in Obsidian's settings search on 1.13 and later. Older versions fall back to the existing display() renderer.
  • builtin-modules replaced with builtinModules from node:module in the build config.

Folding behaviour is unchanged. Requires Obsidian 1.5.0 or later.

1.0.1

Choose a tag to compare

@github-actions github-actions released this 15 Nov 02:19

Fixes a plugin-guideline issue found during directory preparation.

  • Settings tab now uses Setting.setHeading() instead of a raw <h3>, so the "Heading levels" section renders consistently with other plugins.

Behaviour is unchanged from 1.0.0. Requires Obsidian 1.5.0 or later.

1.0.0

Choose a tag to compare

@github-actions github-actions released this 15 Nov 02:16

First public release.

Accordion Headings replaces Obsidian's built-in heading fold with the standard accordion pattern: a single chevron that stays in place and rotates between states, and a heading row you can click anywhere.

What's in it

  • Reading view — Obsidian's own .heading-collapse-indicator is stretched to cover the full heading row, and the chevron is drawn on the heading's ::after. Collapsed state is read from the indicator's is-collapsed class.
  • Live Preview / Source — a CodeMirror 6 widget places the chevron inline after the heading text and toggles Obsidian's fold state with foldEffect / unfoldEffect, so the Outline panel and Fold all / Unfold all stay in sync.
  • Settings — icon style (chevron or plus/minus), visibility (always or on hover), and per-level enable for H1–H6.

Install

Requires Obsidian 1.5.0 or later. Desktop and mobile.

  • Manual: download main.js, manifest.json and styles.css below into <vault>/.obsidian/plugins/accordion-headings/, then enable the plugin.
  • Beta via BRAT: add stevemclin/accordion-headings.

Known limitations

  • ATX headings (#–######) only. Setext headings keep Obsidian's default behaviour.
  • In Live Preview, clicking the heading text places the cursor rather than folding, so headings stay editable. Use the chevron or the empty space to its right.