Skip to content

v1.2.0

Latest

Choose a tag to compare

@d12frosted d12frosted released this 02 Jul 16:41
· 87 commits to master since this release
v1.2.0
54e4478

Added

  • Fix violations straight from the schema dashboard. Invalid notes now start collapsed and expand to their individual violations, each row showing the field and a terse reason alongside a fix button (the per-note widget's view, one level deeper). Fixing pops the note open at that field only while the prompt (via vulpea's vulpea-schema-fix-violation) is open, then writes the value, re-indexes, refreshes, and restores your previous window layout so you land back on the dashboard; you see what you are fixing and where, and can fix or skip each one on its own; the field name jumps to the note without fixing. The fix button shows only when the running vulpea provides the fixer. Schema and note headers use vui-flex to right-align their counts (#16).

  • Schema dashboard, a collection-wide M-x vulpea-ui-schema-dashboard view in a *vulpea schema* buffer (not the sidebar). It lists every registered schema with how many notes it covers and how many are invalid, sorted so the schemas needing attention come first and unused ones sink to the bottom, with :include relationships annotated both ways (includes / included by). Each schema is collapsible and those with violations start expanded; expand one to see its invalid notes as clickable links that jump to the note, where the health widget and quick-fix actions take over. g rescans, q buries the buffer. Built on vulpea's vulpea-schema-collection-health, so the scan is one query plus an in-memory pass and stays fast on large collections (#16).

  • Quick-fix actions in the schema health widget. Each violation row gets a fix button that prompts for a corrected value - :one-of completion, note selection honouring :target-tags, multi-value fields - and writes it back via vulpea's vulpea-schema-fix-violation, then saves the note, re-indexes it, and refreshes the sidebar so the fixed violation clears. The button only shows when the underlying vulpea provides vulpea-schema-fix-violation (an older vulpea still renders the row, just without the button), and it is styled with the new vulpea-ui-schema-health-action-face (#38).

  • Schema health widget: a per-note "is this note healthy?" view in the sidebar. When the current note matches one or more schemas it shows a green healthy line if the note conforms, or its violations otherwise - each a severity-coloured bullet (red for structural problems like a missing field, a wrong type or a bad reference; amber for value problems like a disallowed value, a failed :validate or a bad target), the field name, and a terse reason ("required", "not one of red/white/rose", "expected a number"). It hides entirely when no schema applies, the same graceful-empty behaviour as the stats widget. Glyphs (vulpea-ui-schema-health-ok-glyph, -issue-glyph, -bullet) and the inheriting faces are customizable. Built on vulpea's schema engine (vulpea-schema-note-violations, vulpea-schema-applicable); clicking a field jumps to it in the note (a missing field jumps to the metadata block, where it would be added), and quick-fix editing actions are tracked in #38 (#29).

  • Unlinked mentions widget showing notes that mention the current note's title or aliases as plain text without an id: link back. It is the sidebar's first asynchronous widget: the search is delegated to vulpea-note-unlinked-mentions-async (ripgrep) and rendered via vui-use-async, so it shows a loading state, fills in when results arrive, and caches them until the note changes or the sidebar is refreshed. Requires ripgrep and vulpea 2.4.0+ (#13).

  • Outgoing mentions widget, the counterpart to the unlinked mentions widget: it shows existing notes that the current note mentions as plain text without an id: link to them - the notes you may want to link out to. Suggestions are grouped by the note you could link to, and clicking a context line jumps to the mention in the current note. Like the unlinked mentions widget it is asynchronous: the search is delegated to vulpea-buffer-unlinked-mentions-async (ripgrep, scanning the note's live buffer so unsaved edits count) and rendered via vui-use-async, with a loading state and results cached until the note changes or the sidebar is refreshed. Requires ripgrep and vulpea 2.4.0+ (#33).

  • Presentation-only note filters for both mention widgets: vulpea-ui-unlinked-mentions-note-filter and vulpea-ui-outgoing-mentions-note-filter (both default identity) take a predicate on the note and drop non-matching mentions before display, mirroring vulpea-ui-backlinks-note-filter. Handy for hiding e.g. index notes from suggestions without touching the collection-wide vulpea-mentions-note-filter (#33).

  • Quick-link actions in the outgoing mentions widget. Each suggestion has a link button (before the context) that rewrites that plain-text occurrence in place as an id: link, and each note group has a link all button that links every occurrence for that note at once. Linking re-validates against the live buffer before editing (matching the note's title or aliases word-bounded and case-insensitive, skipping occurrences already inside a link), so a stale or already-linked suggestion is a no-op. It keeps point where it is and does not auto-refresh, so you can link several in a row without losing your place; press g to update the list. The new vulpea-ui-mention-action-face styles the buttons (#33).

Changed

  • Raise the minimum dependencies to vui 1.3.0 and vulpea 2.5.0. This release's schema views - the schema dashboard, the per-note schema health widget and the quick-fix actions - are built on vulpea 2.5.0's schema engine (vulpea-schema-collection-health, vulpea-schema-note-violations, vulpea-schema-applicable, vulpea-schema-fix-violation and the vulpea-schema-health struct), and the dashboard's cursor-stable collapsibles, the move off widget.el accessors onto vui's public element API (vui-element-at, vui-element-get, vui-key-at, vui-activate, vui-goto-key) and vui-collapsible's :header-right / :header-width all landed in vui 1.3.0. The schema code still fboundp-guards its vulpea entry points, so a stale vulpea degrades gracefully instead of erroring, but 2.5.0 is what the new views actually need.

Documentation

  • Document vulpea-ui-widget-set as the public way to attach a predicate to an already-registered widget, with a worked example showing how to toggle a built-in widget per note via a defvar + an org property (#25). Thanks @darcamo for the suggestion.
  • Reveal the full range of vulpea-ui-sidebar-size values in its docstring and customize :type - a float fraction, an integer, a (body-lines . N) / (body-columns . N) cons, or a window-adjusting function - and point at Info node (elisp) Buffer Display Action Alists. Thanks @drcxd for the docstring and the change (#44).

Fixed

  • Work with vui's text-button rendering again. vui now renders buttons as button.el text buttons rather than widget.el widgets, so my old widget.el accessors (widget-at, widget-get, widget-apply) came up empty on them and the schema dashboard code and tests broke. Migrated the one code path and the tests onto vui's public element API (vui-activate, vui-key-at, vui-element-at / vui-element-get), which hides the rendering mechanism, so vulpea-ui no longer cares whether an element is a button or a widget.
  • Keep point where it is when toggling or refreshing the schema dashboard. The section and note headers were hand-rolled buttons with the ▶/▼ indicator baked into the label and no key, and the violation rows carried a fix button (the same label on every row) and field buttons with no key, so on a toggle, a g refresh, or an after-fix refresh cursor restoration could not re-find the widget point was on and point jumped to the top of the buffer. The dashboard now builds on vui-collapsible, which gives every toggle a stable cursor identity across the ▶/▼ flip and right-aligns the count/status to the window edge via its new :header-right / :header-width; the fix and field buttons carry keys that stay unique even when the same note is invalid under more than one schema, so point rides its widget across toggles and refreshes instead of falling to the top (#16).
  • Keep point in place after fixing a violation from the schema dashboard. A fix removes the row point sat on (and, once it was the note's last issue, the whole note), so there was no widget left for cursor restoration to return to and point dropped to the top of the buffer. vui recovers point to the nearest surviving row in the component tree, but only when point is on a widget when the buffer redraws, and clicking the fix button with the mouse does not move point, so it could be sitting on the summary line at the top, which vui faithfully keeps. So the fix action now anchors point on the note it just fixed before refreshing, and vui recovers from there to the note that slid into the fixed one's place, or the previous note in the same section once you clear its last one, so you stay where you were working inside that section instead of jumping to the top or down into the next schema (#16).
  • Keep point in place when refreshing the sidebar with g. The mention widgets re-scan asynchronously, and a refresh used to blank them to their loading state, so the buttons point was on disappeared and the cursor fell back to the top of the sidebar. They now keep the previously loaded list on screen while the re-scan runs (cached per note via a ref), so the widget structure stays stable and point is preserved. Applies to both the unlinked mentions and outgoing mentions widgets (#33).
  • Stop treating other side windows (e.g. a *Help* or *Info* buffer that the user's display-buffer-alist pins to a side) as the main window. vulpea-ui--get-main-window now skips any window with a window-side parameter, so merely focusing such a window is no longer mistaken for switching away from the vulpea note. Previously this triggered an auto-hide/re-show of the sidebar on every focus change; combined with window-combination-resize, the repeated delete/recreate of the side window steadily shrank the note window until it collapsed (#36). Thanks @drcxd for the report.
  • Display the sidebar even when the user disabled side windows on its configured side via window-sides-slots (e.g. '(1 0 0 1) to forbid right-side windows). Previously display-buffer-in-side-window returned nil, the sidebar buffer silently took over the selected window, and a follow-up auto-hide attempt errored with "Attempt to delete ... sole ordinary window". A local copy of window-sides-slots now guarantees the sidebar's side at least one slot (vulpea-journal#21). Thanks @drcxd for the report.
  • Only delete the sidebar window when it is a real side window. vulpea-ui--hide-sidebar-window (used by auto-hide and vulpea-ui-sidebar-close) now leaves a regular window untouched instead of deleting a main or sole window, hardening teardown against the error above (vulpea-journal#21).
  • Skip rendering the sidebar when the frame has no live side window. Because mounting calls switch-to-buffer, a render attempt without a side window used to replace the selected window's buffer with the sidebar; vulpea-ui--render-sidebar now bails out instead of clobbering an unrelated window (vulpea-journal#21).
  • Guard mode-line-invisible-mode call with fboundp since it is only available starting from Emacs 31.
  • Suppress inline image and LaTeX previews in parsing temp buffers, fixing crash when sidebar encounters notes with attachment: links and #+startup: inlineimages (#21). Thanks @eamonnsullivan for the report.
  • Use org-inhibit-startup instead of individual variable suppression in parsing buffers, fixing crash when buffer-level #+startup: inlineimages keyword overrides let-bound variables in newer Emacs/Org versions (#23). Thanks @eamonnsullivan for the follow-up report.
  • Strip org markup from outline heading titles so links and similar constructs no longer show as raw markup in the outline (#20). Thanks @evertedsphere for the report.

Thanks

Huge thanks to @eamonnsullivan, @evertedsphere, @darcamo, and @drcxd for the reports and contributions that shaped this release. 💛