From ec140125f208d5f6e507dfe6b8e9abc7236cb21b Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 10 Nov 2026 16:25:12 +0100 Subject: feat(assistant): a faint picture behind the Assistant tab `[assistant] background` names an image (none by default); the server serves it at /api/bg behind the token, and the tab shows its subject from the right side, desaturated and faded out on every side so no edge shows: opacity .24 while the chat is empty, .07 during a conversation. Tuned on the 1280x800 tablet. Co-Authored-By: Claude Opus 5.5 --- deckit/server.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'deckit/server.py') diff --git a/deckit/server.py b/deckit/server.py index 835b612..19edbef 100644 --- a/deckit/server.py +++ b/deckit/server.py @@ -108,6 +108,16 @@ def art(): return None +def background(): + """The Assistant tab's backdrop, `[assistant] background`; None when unset.""" + name = CFG.get("assistant", {}).get("background", "") + path = Path(name).expanduser() + try: + return (path.read_bytes(), mimetypes.guess_type(path)[0] or "image/jpeg") if name else None + except OSError: + return None + + _font = {} @@ -194,6 +204,9 @@ class Handler(BaseHTTPRequestHandler): if len(parts) == 2 and parts[1] == "art": image = art() return self._send(200, image[0], image[1], cache=True) if image else self._send(404) + if len(parts) == 2 and parts[1] == "bg": + image = background() + return self._send(200, image[0], image[1], cache=True) if image else self._send(404) if len(parts) == 2 and parts[1] == "modules": return self._json(REGISTRY.names()) if len(parts) == 2: -- cgit v1.2.3