Commit Graph
12 Commits
Author SHA1 Message Date
Donkie 21651216af Turn the locations page into a group-by-anything dashboard
The locations board could only ever answer one question: where is this
spool. The same card-and-drag interaction works for any field a spool
carries, so make the field a view mode and keep the rest.

Location is still the default view and behaves exactly as before. The
other views come from the user's own spool fields: any single-value text
or choice field now appears in a Group-by menu. A choice field renders a
card per choice, including the empty ones, which turns a "Status" field
into a kanban board.

Which field a card belongs to is decided by one small interface
(src/lib/dashboard/fields.ts), so the page never special-cases a field.
A field only qualifies if the SPOOL OWNS IT, because a drag moves one
spool and must mean exactly one change. That rules out material and
vendor, where writing one spool's card would silently rewrite every other
spool of the same filament, and lot number, which is stamped on by the
manufacturer and would be recording something untrue. Those stay library
filters. It also rules out numbers, dates, booleans and multi-choice,
whose values don't name a card you can drag into.

Backing changes:

- /spool/group grows group_by=extra.<key> for a spool's custom fields.
  The field table is aliased so it stays a distinct FROM element -- the
  extra-field filters reference the un-aliased table inside correlated
  subqueries, and without the alias those would correlate to this join
  instead of standing alone. Grouping is rejected for field types whose
  value isn't a single repeatable string. group_by is no longer a
  Literal, so an unsupported value is a 400 rather than a 422.

- The saved layout is per field: dashboard_groups and
  dashboard_spoolorders replace the location-only pair. The old
  `locations` / `locations_spoolorders` are read once as a seed for the
  location view and never written back, so an upgrade keeps the shelves
  it had and the old client keeps working.

- The view mode lives in the URL (?by=) so a board can be bookmarked and
  shared, and is mirrored to localStorage so a bare /dashboard resumes
  the last one looked at. The URL wins when it says something; a stale
  ?by= naming a deleted field falls back to location.

Verified against SQLite, PostgreSQL, MariaDB and CockroachDB -- Postgres
caught a real difference here, it sorts NULLs last where SQLite sorts
them first, so the new group assertions are keyed rather than ordered.
2026-07-30 08:41:36 +02:00
Donkie 46b69808a6 WIP: add label designer and misc v2 client improvements
Adds a label design/print subsystem (canvas editor, QR/logo/paper
helpers, print layout panel) backed by a new label_designs setting,
plus a footer, datetime field component, and assorted fixes across
the library and settings views.
2026-07-13 10:10:40 +02:00
Erik Michelson e93f89aa51 Add setting to toggle rounding of prices 2024-12-30 01:07:38 +01:00
Donkie bf06408368 Added reading and using of spool orders in locations 2024-11-20 21:57:01 +01:00
Donkie e4175e26ec Added a locations setting so empty locations are still kept around 2024-11-19 22:32:05 +01:00
samturner3 a0e9f10127 Rename setting 'qr_code_url' to 'base_url' 2024-08-26 18:08:13 +10:00
samturner3 2937d7d5bc Merge remote-tracking branch 'upstream/master' 2024-08-24 16:18:17 +10:00
Donkie 71f6ce55f5 Renamed print settings to presets instead, manual preset store button 2024-08-05 16:06:00 +02:00
Donkie 426496b4e5 Recoded label printing settings to store in DB instead of in browser 2024-06-15 14:07:48 +02:00
Michal Kunc 8c19efa2c4 Add QR Code base URL setting 2024-03-04 01:41:26 +01:00
Donkie 77ac9d6a5c Added custom extra fields to backend
No integration tests yet, TBD
2024-01-23 18:58:57 +01:00
Donkie 44da991d47 Added a new backend settings system
This can be used for saving runtime-configurable settings in the database.
2024-01-16 19:17:06 +01:00