Commit Graph
2937 Commits
Author SHA1 Message Date
Zef Hemel adfa5e5596 Bring autofocus back in auth 2026-03-06 13:53:57 +01:00
Zef Hemel 8a2424f27f Fix mini editor regressions 2026-03-06 13:50:29 +01:00
Zef Hemel d6424b714a Merge branch 'main' into to-node 2026-03-06 13:38:23 +01:00
Zef Hemel ad45eebba4 2.5.2 2026-03-06 13:20:22 +01:00
Zef HemelandGitHub 49f1b58dbb Merge pull request #1871 from mjf/fix-table-indexer-empty-cells
Fix table indexer empty cells - continued
2026-03-06 13:15:36 +01:00
Matouš Jan FialkaandGitHub b5fadf4dc2 Merge branch 'silverbulletmd:main' into fix-table-indexer-empty-cells 2026-03-06 08:58:08 +01:00
Matouš Jan Fialka 7c35c05367 Fix regression
Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-06 08:52:54 +01:00
Matouš Jan Fialka 9b37060d9f Extract normalizer to helper shared by both parser and renderer
Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-06 08:45:16 +01:00
Zef HemelandGitHub eaa85a990a Merge pull request #1870 from mjf/fix-table-indexer-empty-cells
Fix table indexer shifting columns when cells are empty
2026-03-06 08:37:09 +01:00
Zef Hemel 9db8d822f7 Fixes #1850 2026-03-06 08:31:53 +01:00
Zef Hemel 06e4a4c7ed Fixes #1869 2026-03-06 08:20:45 +01:00
Matouš Jan Fialka c4c0c64fb5 Fix table indexer shifting columns when cells are empty (final)
The Markdown parser omits `TableCell` nodes for empty cells, so
`collectNodesOfType` returns fewer cells than columns.

The indexer mapped cells to headers by array index, causing all cells
after an empty one to shift left.

The HTML renderer already solved this: its `TableRow` case walks the
children and injects empty `TableCell` nodes between consecutive
`TableDelimiter` nodes with no cell in between.

This patch extracts that same normalization logic into a reusable
`normalizeTableRow` helper and applies it to each row before collecting
cells.

The original index-based cell-to-header mapping then works correctly
without any positional arithmetic. I feel like this is more elegant
solution to the issue.

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-06 08:16:26 +01:00
Zef Hemel dbf275d75b Introduce biome as linter with lint fixes 2026-03-06 08:05:13 +01:00
Matouš Jan Fialka 9e4f5f7bc6 Fix table indexer shifting columns when cells are empty
For example, with the following table:

```markdown
| a   | b   | c   |
| --- | --- | --- |
| 1   |     | 3   |
| 1   | 2   | 3   |
| a   | b   | c   |
| a   | b   |     |
|     | b   | c   |
| x   |     |     |
|     |     | z   |
```

the following query results in dataset with shifted columns
when cells are empty:

```lua
from
  index.tag 'table'
where
  page == 'test'
order by
  pos asc
select {
  a, b, c
}
```

This is now fixed and gives correct results:

|0 |1 |2 |
|--|--|--|
|1 |  |3 |
|1 |2 |3 |
|a |b |c |
|a |b |  |
|  |b |c |
|x |  |  |
|  |  |z |

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-06 07:56:21 +01:00
Zef Hemel de32dfb0f5 Auto discover lua test files 2026-03-05 16:39:19 +01:00
Zef Hemel 873fa7e4f5 Further simplification of runtime loading 2026-03-05 16:38:05 +01:00
Zef Hemel 9d39c8b1b8 Merge branch 'main' into to-node 2026-03-05 16:26:16 +01:00
Zef Hemel 91ecfcbd60 2.5.1 2026-03-05 16:12:49 +01:00
Zef Hemel 4b66106c20 Reduce logging in common cases 2026-03-05 16:11:32 +01:00
Zef Hemel 19483e8687 Attempting to determine the build time in a more reliable way 2026-03-05 16:03:25 +01:00
Zef Hemel e9266d467e (Debug) bundle timestamps 2026-03-05 15:28:35 +01:00
Zef Hemel 17418fd7ec Pull reported client version number from system.getVersion() 2026-03-05 15:07:25 +01:00
Zef Hemel 0768884b7c Log SilverBullet version on server boot 2026-03-05 14:44:47 +01:00
Zef Hemel 92d4807d52 2.5.0 2026-03-05 14:15:03 +01:00
Zef Hemel c299a65198 Updates to HTTP API docs 2026-03-05 14:15:03 +01:00
Zef HemelandGitHub e14d0a3dfd Mildly reduce hostility in contribution guide 2026-03-05 08:23:12 +01:00
Zef Hemel e1daa7204d CHANGELOG and Space Overview updates reflecting new space-lua ordering 2026-03-05 08:20:43 +01:00
Zef Hemel 856b176ce7 Fixes #1864 by making ordering stable 2026-03-05 08:12:19 +01:00
Zef Hemel 444349c3f3 Cleanup plug runtime loading during compilation
Note: drops custom worker URL support (which I doubt anybody used)
2026-03-04 16:07:38 +01:00
Zef Hemel e218433f52 Merge remote-tracking branch 'origin/main' into to-node
# Conflicts:
#	client/space_lua/query_collection.test.ts
2026-03-04 15:47:09 +01:00
Zef Hemel 1178f7bc92 Fix: ordering of space-lua scripts
No priority defined now means priority 0
2026-03-04 15:40:59 +01:00
Zef Hemel 9a92bced1f CHANGELOG updates 2026-03-04 14:55:19 +01:00
Zef HemelandGitHub 5ece01147a Merge pull request #1867 from mjf/space-lua-liq-add-order-by-using
[Space Lua] LIQ: Add `using ...` support to `order by`
2026-03-04 14:35:00 +01:00
Zef Hemel 6387b3a864 Actually include the Journaling guide... 2026-03-04 14:24:27 +01:00
Zef Hemel 405899781e Added journaling guide to website content 2026-03-04 14:23:59 +01:00
Zef Hemel 35542a2cc9 Missing website files, whoops 2026-03-04 13:39:27 +01:00
Zef Hemel 59c271131b Big website content iteration 2026-03-04 13:31:27 +01:00
Matouš Jan Fialka 879bfb811a [LIQ] group by: Convert plain JS objects to LuaTable in results
Items from `index.tag` are stored as plain JS objects when no metatable
is defined. The `group by` clause wraps rows in `LuaTable` (`key`,
`group`) but leaves the individual `group` items as plain JS objects.
This causes `t.keys is not a function` errors when passing `row.group`
to APIs like `template.each` that expect `LuaTable` instances.

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-04 11:47:28 +01:00
Matouš Jan Fialka df998ebc68 [LIQ] order by: Pre-compute sort keys before merge sort (Schwartzian transform)
Evaluate all `order by` expressions once per item in a decorate pass,
then compare cached keys during sort. Reduces Lua eval calls from
*O(kn log n)* to *O(kn)* where *k* is the number of sort keys.

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-04 09:58:43 +01:00
Matouš Jan Fialka a1024212ee [LIQ] order by: Replace Quicksort with merge sort with SWO violation detection
- Add iterative async stable merge sort (*O(n log n)*).
- Replace Quicksort with the new merge sort (kept Quicksort for tables).
- Update documentation (reorganize for logical flow, add SWO section
  with invalid comparator example that really throws).

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-04 09:06:11 +01:00
Matouš Jan Fialka 01dd7c1db4 [Space Lua] LIQ: Add using ... support to order by
* support for custom comparators in LIQ `order by` clauses via the
  `using` keyword.

* `using` is mutually exclusive with `asc`/`desc` and accepts either
  a *named function* or an *inline anonymous function*. The comparator
  receives two values and returns true if the first should come before the
  second.

* `nulls first`/ `nulls last` works independently of `using`.

* `using` is now a reserved keyword (`kw`; this cannot be avoided but
  the chance to collide with user scripts is negligable),

* documentation updated + polished a little

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-03 14:47:28 +01:00
Zef HemelandGitHub 82f10fa59f Merge pull request #1858 from mjf/space-lua-fix-liq-ordering
[LIQ] Fix `group by`: `order by` with `select` aliases, variable binding in `having` and `nil` column ordering
2026-03-03 10:58:45 +01:00
Zef Hemel ba297f66db Doc tweaks (less duplication of queryies and more use of bound queries) 2026-03-03 10:43:30 +01:00
Matouš Jan Fialka 7cc39ce62f Show null/missing query cells as empty instead of *(null)*
Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-03 09:25:45 +01:00
Matouš Jan Fialka b786d65307 [LIQ] Add filter(where <cond>) clause for per-row aggregate filtering
Implements `filter(where <cond>)` for aggregate functions in LIQ
queries which allows per-row conditional filtering within grouped
aggregates. Also extends test suite and documentation.

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-03 08:29:18 +01:00
Matouš Jan Fialka e35b61d050 Rename LUA_SQL_NULL to LIQ_NULL
Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-02 14:07:07 +01:00
Matouš Jan Fialka 0d49a7b0de [Space Lua] Load scripts without priority last during reload
The new null-aware ordering in `orderByCompare` changed the default
placement of undefined values for descending sorts to `nulls first` (SQL
standard). This caused Space Lua scripts without a `-- priority:`
comment to load before the `Std` library scripts and breaking the boot
sequence for user scripts ran before `schema`, `config`, `widget` and
other core definitions were available.

Add explicit `nulls: "last"` to the reload query so scripts without
priority always load last, matching the documented behavior.

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-02 13:44:28 +01:00
Matouš Jan Fialka ff6854f6ee [LIQ] Add nulls first / nulls last to order by
Extend the `order by` clause with optional `nulls first` and `nulls
last` modifiers following standard SQL semantics. Each sort key can
independently specify where `nil` values should appear in the result. By
default, ascending sorts place nulls last and descending sorts place
nulls first. An explicit nulls first or nulls last overrides this
default. The `asc` keyword is also now accepted as an explicit
alternative to the default ascending direction. Documentation and tests
were updated accordingly.

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-02 12:34:25 +01:00
Zef Hemel f3ed6ec5dd Fixes #1863 2026-03-02 11:46:07 +01:00
Zef HemelandGitHub ad27466268 Merge pull request #1861 from gitlon/patch-1 2026-02-28 06:50:11 +01:00