feat(api): implement per-user edit token for settings mutations

This commit is contained in:
shay
2026-04-19 09:34:26 -04:00
parent 3ecb6ad67b
commit 016583c9f3
16 changed files with 774 additions and 116 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ def render_achievements_widget(
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="{t["text"]}">{escape(ach.title)}</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="{t["text_secondary"]}">{escape(ach.subtitle)}{(" · " + ach.event_date) if ach.event_date else ""}</text>
font-size="10" fill="{t["text_secondary"]}">{escape(ach.subtitle)}{(" · " + escape(ach.event_date)) if ach.event_date else ""}</text>
</g>'''
total_h = len(shown) * 56 + 50
+2 -2
View File
@@ -2,7 +2,7 @@
from ..models import CollaboratorData
from ..themes import THEMES
from ..utils import escape, card_wrapper
from ..utils import escape, card_wrapper, safe_color
def render_collaborators_widget(collabs: list[CollaboratorData], theme_name: str = "dark", settings: dict | None = None) -> str:
@@ -15,7 +15,7 @@ def render_collaborators_widget(collabs: list[CollaboratorData], theme_name: str
t = THEMES[theme_name]
s = settings or {}
max_count = min(max(int(s.get("max_count", 5)), 1), 10)
bar_color = s.get("bar_color") or t["purple"]
bar_color = safe_color(s.get("bar_color"), t["purple"])
items = ""
for i, c in enumerate(collabs[:max_count]):
+2 -2
View File
@@ -2,7 +2,7 @@
from ..models import ImpactWeek
from ..themes import THEMES
from ..utils import card_wrapper
from ..utils import card_wrapper, safe_color
def render_impact_widget(weeks: list[ImpactWeek], theme_name: str = "dark", period: str = "6mo", settings: dict | None = None) -> str:
@@ -13,7 +13,7 @@ def render_impact_widget(weeks: list[ImpactWeek], theme_name: str = "dark", peri
"""
t = THEMES[theme_name]
s = settings or {}
line_color = s.get("line_color") or t["accent"]
line_color = safe_color(s.get("line_color"), t["accent"])
w, h = 380, 200
chart_x, chart_y = 40, 8
chart_w, chart_h = 316, 82