45 Commits
Author SHA1 Message Date
Yuri Karamian fbabcf5099 fix(android): keep scaled layouts within the screen 2026-11-10 11:09:01 +04:00
Yuri Karamian 237bf799e3 fix: toggle selected paragraphs as one code block 2026-11-06 12:33:49 +04:00
Yuri Karamian 77164427f1 fix: keep table horizontal scrolling when notes open read-only
TipTap registers the table node view together with column resizing only when the editor starts editable. Opening a note in View mode therefore left tables without their .tableWrapper, so wide tables could not scroll horizontally until the app was restarted in Edit mode.

Keep the table view plugin installed for read-only editors; its resize handlers still ignore non-editable views.

Add a regression test that the table node view is registered when the initial editor is read-only. (Discord report)
2026-11-05 01:27:11 +04:00
Yuri Karamian 6ecde99f25 fix: keep formatting and single spacing when copying
Copied notes now use inline single spacing, so Word and email clients no longer add their own paragraph spacing. Context-menu Copy and Cut now write rich HTML with a plain-text fallback instead of text only, preserving formatting and blank lines.

Add "Copy as Plain Text" to the context menu and a "Single" line-spacing preset in Settings.

Add regression tests for clipboard HTML spacing.
2026-11-04 02:03:28 +04:00
Yuri Karamian a466df85ed fix: stop compose and dead keys from adding stray quotes around accents
Typing é with a compose key (Compose ' e) or a dead key on Linux gave
'é' instead of é, with the first quote curled by Typography. Every
accented letter was affected.

GTK shows the keys typed so far as a preedit in the editor (· then ')
and replaces it at each step. ProseMirror reports that replacement as
a quote typed over a non-empty range. WrapSelectedText only checked
that the range was non-empty, so it treated the preedit as a selection
and wrapped it in quotes. The composition then removed its own preedit
but left the added quotes behind.

Wrap only when the range is exactly the user's selection and no
composition is active. Selecting text and typing ( or " still wraps
it.

Move the logic into wrapSelection() and cover it with tests.
2026-10-30 17:28:54 +04:00
Yuri Karamian 1676f9fbd1 fix: keep the link around an image and the size of HTML images on save
An image inside a link lost the link the first time the note was saved,
and <img width=...> lost its size. Images now keep the link around them
and are written back as HTML when they have a width or height. Only a
single plain image line is joined to the block above, as the parser
reads it, so a linked or sized image keeps the blank line before it.
2026-10-17 22:53:19 +02:00
Yuri Karamian 3b59d34fed fix: keep links working when notes are renamed or moved
Renaming through the title field saved the new title before the file was
renamed, so the rename took the new title for the old one and [[Old]]
links were never updated. It now uses the old file name.

A rename now also updates heading and block links, other capitals,
[[Note.md]] and Markdown links to the file. Moving a note, and renaming
or moving a notebook, updates links that contain a folder, keeping each
link's form, and points the moved notes' own relative links from their
new folder. Code is left as written, and a name another note shares is
not rewritten. Open notes with unsaved edits follow the same rules,
checked on both sides against tests/fixtures/renamed-links.json.
2026-10-17 16:48:30 +02:00
Yuri Karamian 4e2c87434d fix: show images glued to the empty-line marker by older versions
Before 1.3.7 an empty line before an image could be saved as
<!-- -->![](image.png) on one line, which reads as raw HTML and showed
the image as text. That line is now read as the empty line plus the
image, and the next save writes them apart.
2026-10-14 08:53:58 +02:00
Yuri Karamian c0058f43f4 perf: reuse the wiki title index, parsed note dates and skip grammar guessing
Opening a note rebuilt the wiki-link title lookup every time; it is now
built once per titles list and the list is replaced, not mutated, when a
title changes. Re-sorting the note list on each external file change
re-parsed every note's date; parsed dates are now kept per entry. A code
block naming a language without a grammar (mermaid, a typo) ran every
registered grammar on each keystroke; it is now left plain.
2026-10-13 14:19:27 +02:00
Yuri Karamian 6986546f20 fix: find and update aliased wiki links in table cells
In a table cell the alias separator is written \|. The graph did not
find such links and renaming a note did not update them.
2026-10-11 13:37:14 +02:00
Yuri Karamian 1289e865ce fix: keep angle-bracket text and comments when a note is saved
Text such as List<String> or <username> was read as an HTML tag and
deleted on the next save, and HTML comments were dropped. Anything in
angle brackets that is not an HTML element now stays text, and
comments are kept and shown. A numbered list that starts at 0 keeps
its numbering.
2026-10-11 09:43:24 +02:00
Yuri Karamian 0f946ca330 feat: replace in note
The find bar gets a second row with Replace and Replace all, opened
from the bar or with Ctrl+H (Cmd+Option+F on macOS, rebindable). It
works in the rich editor and in source mode, and replace all is one
undo step. Replacing the text of a wiki link changes what it shows,
not its target.
2026-10-11 01:39:03 +02:00
Yuri Karamian 39c56f7e13 fix: keep unsaved edits when a linked note is renamed
Renaming a note rewrites the links to it in other notes. A note that
was open with unsaved edits then failed its next save with a conflict,
and the rewritten notes had no copy of their previous state.

The rename now reports the notes it rewrote. Their previous state goes
into version history, and an open editor takes over the new links and
continues from the rewritten file.
2026-10-11 01:39:03 +02:00
Yuri Karamian 9b8602e20f fix: keep literal text literal when a note is saved
Text that reads as Markdown (asterisks around words, a line starting with
"1." or "#", an HTML tag or entity written as text) lost its escaping on
save and came back as formatting. It is now written with a backslash, but
only where the parser would otherwise read it differently, so ordinary
notes are written as before. Text that reads as a link or an image is
still left to become one, and a line the note already had unescaped keeps
its previous behavior.
2026-10-10 22:36:58 +02:00
Yuri Karamian e168f4e004 fix: no indented blank line after a nested list
A nested list left an indented blank line behind when saved, which showed
as an extra empty line after the list in source view.

Refs #277
2026-10-10 13:34:39 +02:00
Yuri Karamian 8df5efacb8 fix: write spaces at the edges of bold and italic outside the markers
Text formatted with a trailing or leading space was saved as **bold **rest,
which Markdown does not read as bold, so it showed as literal asterisks
after reopening. Edge spaces now go outside the markers and a mark over
only spaces is not written. Formatting around an inline code span is
dropped when a letter or digit touches it, where it would not render.

Refs #240, #276
2026-10-10 13:34:38 +02:00
Yuri Karamian f0bf0ac5e3 fix: keep bare code fences, link titles, table alignment and formatted inline code
A round-trip audit of 1590 notes showed four things lost the first time a
note was edited. A code block without a language was saved as "text".
Link titles were dropped. Table column alignment was reset. Bold or
italic around inline code was removed.

All four now survive loading, editing and saving. Formatting that covers
only part of a code run is still dropped, since it cannot be written
inside a code span.
2026-10-10 10:19:04 +02:00
Yuri Karamian 0ecacbe1dd fix: parse lines with many unclosed links in linear time, and close a stale image toolbar
A line with thousands of unclosed [label]( starts took about 1.1 s at
56 KB, because each start read to the end of the line for its closing
parenthesis. The legacy link rule now skips starts beyond the last
closing parenthesis and bounds the failed searches per block.

The image toolbar stayed open after an undo and its buttons then changed
a different image. It now closes when its image is no longer at the
remembered position.
2026-10-09 23:28:46 +02:00
Yuri Karamian 455b059fb5 fix: group images a blank line apart into a grid, and keep blank lines on ungroup
Images separated by a blank line load with an empty paragraph between
them, so the Grid button never found two neighboring image blocks and
did nothing in an existing note. Grouping now spans a single empty
paragraph between image blocks and takes the one above the first image,
which would otherwise be saved as a marker line above the grid.

Ungroup gave each image its own paragraph but no blank line, so the
images were saved directly under the preceding paragraph and became part
of it on reload. Top-level grids now ungroup into images a blank line
apart, the reverse of grouping them.

Refs #254
2026-10-09 23:06:53 +02:00
Yuri Karamian f4c6649c0a Merge branch 'feature/side-by-side-grid-masonry-layout-for-images' into 'main' 2026-10-09 22:50:50 +02:00
Shawn Olson 9aa9ca7d3e test: keep the grid title assertion independent of the image title policy 2026-10-09 09:12:25 -07:00
Shawn Olson 0b94d9ff32 feat: keep image hover titles ("title") and let users edit them
Images now keep their CommonMark title as hover text through load, edit and
save: `![alt](image.png "Hover text")`. Link titles are still dropped, as
before.

Parsing:
- helix_images no longer strips `title` from images (links unchanged).
- An image whose destination and title are valid CommonMark now uses
  markdown-it's own image rule instead of the legacy-link rule. Previously
  any space before a title sent the image down the legacy path, which can't
  handle escaped quotes (`"Say \"hi\""`) or `(title)` titles and mangled
  them into the URL.
- Genuinely legacy forms (spaces in the path, `%20"title"`) still go through
  the legacy rule, which now also keeps the image's title.

Saving: `serializeImageTitle()` writes ` "title"` with CommonMark backslash
escapes (`\"`, `\\`, and `\&` only before entity-like text). The parser
undoes these exactly, so titles survive any number of saves unchanged.

UI: a "T" button on the image toolbar opens a small dialog to set or clear
the hover text.

Tests: tests/image-titles.test.mjs covers exact round trips for tricky titles
(parentheses, &, entities, quotes, backslashes, markup), no growth over
repeated saves, the written form, titles from other apps, legacy
destinations, and links still dropping titles. The upstream assertion that
images render without `title=` is updated to the new contract.
2026-10-09 09:12:11 -07:00
Shawn Olson bd86fb8a4d feat: side-by-side image grids via a portable :::img-grid block
Implements #254. Several images can now sit side by side in a grid or masonry
layout with 2 to 4 columns. The syntax is plain Markdown images inside a
`:::` container, so other renderers show the images stacked:

    :::img-grid cols=3 masonry
    ![](a.jpg)
    ![Beach|size=small](b.jpg)
    :::

Parsing is a markdown-it block rule (`helix_img_grid` in markdownParser.ts),
not a text pre-pass:
- Grid syntax inside code blocks is never converted, because code blocks
  claim those lines first.
- A block converts only if every line is exactly one image (CommonMark image
  syntax, so titles, parentheses and <angle> destinations parse as for any
  image). Unknown options, out-of-range columns, captions, linked images,
  blank lines or a missing closer leave the whole block as ordinary Markdown.
- Each grid image is an ordinary inline image token, so it gets the same
  source resolution, `|size=` handling and title policy as other images.

Saving writes the grid as a normal block through joinMarkdownBlocks, with a
blank line before it. The images serialize with the same code as images in
paragraphs, one per line. The header is written in canonical form.

Editor (src/lib/editor/extensions/imageGrid.ts):
- `imageGrid` node (`image+`) whose renderHTML includes data-img-grid, so
  copied grids paste back as grids
- header controls: cycle columns, grid/masonry toggle, ungroup
- image toolbar: "Grid" groups the image with neighboring image-only blocks;
  arrow buttons move an image left or right inside its grid
- drag-and-drop reorder within and between grids; an emptied grid is removed
- `/image-grid` slash command: multi-file picker that inserts a grid, using
  the origin-guarded asset saving
- mobile: 3-4 column grids collapse to 2. Print: compact 2-column rows,
  controls hidden

Tests (tests/image-grid.test.mjs) cover byte-identical round trips, sizes,
code-fenced examples, no partial conversion, titles and angle-bracket
destinations, repeated saves, trailing closers, nesting, reloading next to
other blocks, renderHTML/parseHTML agreement, grouping and reorder targets.
2026-10-09 09:09:02 -07:00
Yuri Karamian 076234974a fix: parse long link destinations in linear time, and polish small mobile and history details
Strip a legacy link title with a single scan instead of a regular
expression that is quadratic on a long run of spaces. Widen the done
checkbox's tap area on phones without changing its look, and say "1
unchanged line" in Version History when only one line is folded.
2026-10-08 01:04:18 +02:00
Yuri Karamian 4aa72e4c76 fix: keep list blocks, folded callouts and opened notes intact; speed up saving
Keep a second paragraph, code block or quote inside its list item when a
note is saved, indented under the item. Import attachment links that follow
a stray backtick and images indented by four spaces. Keep a folded callout
that was revealed from the Outline open while it is edited.

Stop treating the editor's first normalization of a freshly loaded note as
an edit, so opening a note no longer saves or reformats it. Join serialized
blocks in linear time, so autosaving a large note no longer freezes the page.
2026-10-07 23:42:03 +02:00
Yuri Karamian ea4a5eae26 fix: keep dollar signs, aligned images, attachment names and code spaces intact
Write a literal $ as typed unless plain dollars could create, remove or
re-pair an inline formula. Save portable image paths when a centered,
aligned or styled block is written. Percent-encode a newly stored
attachment's path before it is inserted, and keep a Windows drive letter
literal in paths outside the vault. Keep whitespace-only code spans in
simple list items, task items and table cells.

Compare Version History in bounded time with a synchronous line diff and
an edit limit. Beyond the limit, shared lines at the start and end stay
unchanged and the rest is shown as removed and added.
2026-10-07 22:25:16 +02:00
Yuri Karamian 8d3338ef89 fix: keep callouts, numbered lists, images and blank lines intact on save
Render the first soft break of a callout's opening paragraph as a newline
so the title and body split correctly again. Only turn [ ] and [x] markers
into task items in bullet lists, not numbered ones. Join serialized blocks
in markdown.ts so an empty paragraph before an image is written as a blank
line, and lists no longer gain an extra blank line, without collapsing blank
lines inside code blocks.

In Version History, compare the current note and snapshots after ignoring
leading and trailing blank lines, so unchanged last lines and a blank line
after the frontmatter no longer show as changes.
2026-10-07 22:12:20 +02:00
Yuri Karamian f07241dd3a fix: harden note saves, attachment imports, and Markdown handling
- Fix new-note save conflicts and scoped external Markdown access
- Preserve attachment URIs and links across saves, imports, and moves
- Ignore unused and overridden attachment reference definitions
- Improve Markdown parsing, outline handling, and editor performance
- Optimize graph, task filtering, tags, WebDAV, and Obsidian imports
- Fix note-list metadata wrapping and add regression coverage
- Document saving and close-to-tray behavior
2026-10-06 06:09:14 +02:00
Yuri Karamian 806c63aa65 Add desktop toolbar customization and fix pane toggle icons 2026-09-28 23:28:56 +02:00
Yuri Karamian 923cb9571c Improve search and show save errors
- Show search results in the right notebook or All Notes list
- Scroll to the selected note and highlight matching text
- Keep unsaved edits safe and ignore old or cancelled searches
- Show save errors with a Retry button
- Run graph and vault statistics scans in the background
- Fix folder checks when counting vault files
- Keep desktop window-close code out of mobile builds
2026-09-28 21:06:28 +02:00
Yuri Karamian 640b5e3d10 Improve editor performance and harden note saving
Replace the source editor with CodeMirror and reduce typing-time work.
Virtualize note lists, apply targeted refreshes, and batch search indexing.
Improve vault and in-note search, and bound graph layout work.
Make saves revision-safe and flush pending changes before navigation or close.
Preserve originating-vault ownership across async operations and detached windows.
Harden sync, attachment writes, and notebook/tag appearance updates.
Keep Trash previews read-only and skip restoring trashed notes.
Update AI model presets and isolate streamed responses by request.
Fix local image rendering and preserve portable image paths.
Include regression tests for the changed behavior.
2026-09-28 07:50:46 +02:00
Yuri Karamian b2d0c7175e test: cover built-in theme preset ordering 2026-09-15 15:04:51 +02:00
Yuri Karamian 34a0f9efa3 fix: keep mobile navigation visible with collapsed desktop sidebar 2026-09-06 22:46:11 +02:00
Yuri Karamian 0d11fd01dd fix: preserve hidden note title across editor modes 2026-09-04 14:46:30 +02:00
Yuri Karamian b3c292d6e2 test(paths): cover cross-platform asset resolution 2026-08-17 18:35:26 +02:00
Yuri Karamian 43f15962f7 Revert "chore(release): prepare v1.3.5"
This reverts commit ade146f9f3.
2026-08-17 17:03:01 +02:00
Yuri Karamian ade146f9f3 chore(release): prepare v1.3.5 2026-08-17 16:50:14 +02:00
Yuri Karamian c4a91b8f1c fix(sorting): sort numeric names naturally 2026-08-15 16:18:22 +02:00
Yuri Karamian fcf48a5b7a Fix Markdown mark round-trips (#219) 2026-08-03 14:04:49 +02:00
Yuri Karamian 432e4f472a Keep local tests out of repository 2026-08-03 02:31:55 +02:00
Yuri Karamian 8731ca4ec1 Support mixed nested lists (#39) 2026-08-03 02:26:39 +02:00
Yuri Karamian 550d3ab3e9 Add per-notebook icons and sync 2026-08-03 01:05:07 +02:00
Yuri Karamian e62404d4c0 Fix dragging selected notes to notebooks 2026-08-03 00:27:18 +02:00
Yuri Karamian 54e051ba02 Add configurable startup view 2026-08-03 00:12:55 +02:00
Yuri Karamian 65e09e8fdd fix(mobile): expose notebook actions 2026-07-25 17:51:33 +02:00