From 78c95b522da5df2025e28b27712ddc6cae24956a Mon Sep 17 00:00:00 2001 From: Erik Thiele Date: Thu, 30 Jul 2026 14:45:30 +0200 Subject: [PATCH] Add a Prompts library alongside Links, bump to v2.0.0 New /prompts section extends the existing database (new Prompt model, same SQLite file) and mirrors the Links experience: add a prompt, get it auto-categorized and tagged by AI, filter by category, full-text search, sort, edit, or have the AI re-categorize it. A header nav switch ("Links" / "Prompts") toggles between the two collections; the shared topbar/menu markup was factored into _topbar.html and _topbar_actions.html so both pages (and settings) stay in sync. Each prompt card has a dedicated copy-to-clipboard icon next to edit/delete, so a stored prompt can be reused immediately. Copying uses the raw markdown source (not the rendered HTML) so structure survives when pasted into another AI tool. The copy handler tries the async Clipboard API first and falls back to a hidden-textarea + execCommand('copy') for plain-http/non-secure contexts, with clear success/failure icon feedback either way. Prompt content supports Markdown and is rendered server-side (app/mdrender.py) for the card preview. Since this is user-supplied HTML-adjacent content, rendering goes through two defenses: the raw text is escaped (only '<' and '&', not '>', so blockquotes keep working) before conversion so no raw tag can survive, and the resulting HTML is passed through bleach with a tag/attribute/protocol allowlist so Markdown-generated links can't carry a javascript: URL. Verified against raw + diff --git a/app/templates/index.html b/app/templates/index.html index f86ccf5..c464d9b 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -2,42 +2,7 @@ {% import "_icons.html" as icons %} {% block title %}Meine Links · LinkVault{% endblock %} {% block body %} -
-
LinkVault
- -
+{% include "_topbar.html" %}