New /settings page (linked from the header's burger menu) offers:
- CSV export of the user's links, for spreadsheet apps.
- SQL dump export as INSERT INTO links (...) statements, scoped to
the current user only — never a raw full-database dump, since that
would leak other accounts' password hashes and data. Embeddings are
excluded (regenerated via "KI neu beschreiben lassen" if needed).
- SQL import that re-adds a previously exported dump to the current
account (additive, doesn't touch existing links).
Import safety (app/backup.py): uploaded SQL is never executed against
the real database. Each non-comment line is required to start with
"insert into links" and is run one statement at a time against an
isolated in-memory SQLite database with only a whitelisted `links`
schema (no id/user_id columns) — sqlite3.execute() also rejects
multiple statements per call. Only after that succeeds are rows
copied into the real DB via the ORM, with user_id forced to the
logged-in user. Verified this rejects DROP TABLE, ATTACH DATABASE,
stacked statements, cross-table subqueries, and user_id injection.
Upload is capped at 2 MB.
Also adds download/upload icons and a proper file-input styling
pattern (visually-hidden input + <label> trigger + filename readout),
since the browser's ::file-selector-button pseudo-element didn't
render reliably in testing.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The app was dark-only with the email shown as plain text and a bare
"Abmelden" button. Header now has:
- A light/dark theme toggle (sun/moon icon). Choice persists via
localStorage and is applied before first paint (inline script in
<head>) to avoid a flash of the wrong theme; falls back to the
system preference on first visit. Added a light CSS variable set
alongside the existing dark palette.
- A circular user icon (head-and-shoulders) showing the email as a
tooltip, replacing the plain-text address.
- A burger-menu dropdown with the email, disabled placeholder items
("Tags verwalten", "Einstellungen" — marked "bald") to make room
for future features, and the actual Abmelden action.
Dropdown opens/closes via a small vanilla-JS handler in base.html
(click outside or Escape closes it), consistent with the project's
no-build-step, mostly-HTMX frontend.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Emoji (📚🔖🏷️ ✎ ✕ 🕓⏳🤖⚠️🔍) rendered in each platform's own
colorful style and looked inconsistent. Add app/templates/_icons.html
with small inline SVG macros (Lucide-style, MIT-licensed path data,
stroke=currentColor) and use them throughout instead, so icons pick
up the muted/accent text colors like the rest of the UI.
The needs-review bookmark toggle now uses an outline vs. filled icon
for its two states instead of swapping emoji.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>