feat(admin): dock Settings at the sidebar's foot, fold About into it, draw Settings as a gear
Owner review 2 (R4, R5): the Settings icon, a circle with rays, read as a sun, and the web panel's sidebar spent an entry on About. - branding/ui-icons/icons.py draws Settings as a toothed gear (8 teeth, centre hole) with a new gear() helper and now also writes the web admin's icons.js, so both programs and the panel share one path; it writes UTF-8 with LF on every OS (on Windows it wrote Icons.xaml in the ANSI code page). - The panel's menu has a top group (Dashboard, Users, Archive, Jobs, Logs) and Settings docked at its foot above the account; collapsed, narrow and RTL layouts keep working. - About (version, API, database, uptime) is the last, read-only group of Settings; pages/about.js is gone and #/about opens Settings on that group. The server name and the fingerprint rows are dropped there: the Server and Network groups already show them on the same page. - Admin.Nav.About(.Tip), Admin.About.Name and Admin.About.Fingerprint are removed (pruned in every culture); Admin.Settings.About is new (en, it). - DESIGN.md and the admin mockups follow; the tests read both menu groups and check that About is folded into Settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5209579631
commit
2d9b6ea1b3
50 files changed
+136
-204
No files matched your search
@@ -1,6 +1,7 @@
|
||||
"""Chronos UI icon set (DESIGN.md §5): 16-px grid, 1.5-px strokes, round caps/joins.
|
||||
Each icon = stroke path data + optional fill path data. Generates the WPF resource dictionary
|
||||
src/Chronos.Ui/Icons/Icons.xaml and a preview sheet (icons.svg). Run: python3 branding/ui-icons/icons.py"""
|
||||
src/Chronos.Ui/Icons/Icons.xaml, the web admin's src/Chronos.Server/Admin/web/icons.js and a preview sheet (icons.svg).
|
||||
Run: python3 branding/ui-icons/icons.py"""
|
||||
import math, os
|
||||
|
||||
def rr(x, y, w, h, r):
|
||||
@@ -17,6 +18,18 @@ def arc(cx, cy, r, a0, a1):
|
||||
large = 1 if (a1 - a0) % 360 > 180 else 0
|
||||
return f"M{x0:.2f} {y0:.2f} A{r} {r} 0 {large} 1 {x1:.2f} {y1:.2f}"
|
||||
|
||||
def gear(cx, cy, r_out, r_in, teeth, tip, base):
|
||||
"""Toothed outline, first tooth at 12 o'clock: each tooth has the half-width tip on r_out and base on r_in;
|
||||
the valleys between teeth are arcs on r_in."""
|
||||
f = lambda v: f"{v:.2f}".rstrip("0").rstrip(".")
|
||||
p = lambda a, r: f"{f(cx + r * math.sin(math.radians(a)))} {f(cy - r * math.cos(math.radians(a)))}"
|
||||
t, b, step = math.degrees(math.asin(tip / r_out)), math.degrees(math.asin(base / r_in)), 360 / teeth
|
||||
d = [f"M{p(-b, r_in)}"]
|
||||
for k in range(teeth):
|
||||
a = k * step
|
||||
d.append(f"L{p(a - t, r_out)} A{r_out} {r_out} 0 0 1 {p(a + t, r_out)} L{p(a + b, r_in)} A{r_in} {r_in} 0 0 1 {p(a + step - b, r_in)}")
|
||||
return " ".join(d) + " Z"
|
||||
|
||||
I = {}
|
||||
# Navigation
|
||||
I["Library"] = (rr(1.5,1.5,5.5,5.5,1)+rr(9,1.5,5.5,5.5,1)+rr(1.5,9,5.5,5.5,1)+rr(9,9,5.5,5.5,1), None)
|
||||
@@ -25,7 +38,9 @@ I["Sequence"] = ("M2 12.5 L11.5 3 L13 4.5 L3.5 14 H2 Z", None)
|
||||
I["Archive"] = ("M2 4.5 H14 V13.5 H2 Z M2 2 H14 V4.5 H2 Z M6 8 H10", None)
|
||||
I["Jobs"] = ("M3 8 H13 M3 4 H13 M3 12 H9", None)
|
||||
I["Server"] = ("M4.5 12.5 A3 3 0 0 1 4.2 6.5 A4 4 0 0 1 11.9 5.5 A3.5 3.5 0 0 1 12.2 12.5 Z", None)
|
||||
I["Settings"] = (circ(8,8,2.2)+" M8 1.5 V3.5 M8 12.5 V14.5 M1.5 8 H3.5 M12.5 8 H14.5 M3.4 3.4 L4.8 4.8 M11.2 11.2 L12.6 12.6 M3.4 12.6 L4.8 11.2 M11.2 4.8 L12.6 3.4", None)
|
||||
# Owner review 2: a toothed gear with a centre hole (the circle with rays it replaces read as a sun). Narrow teeth
|
||||
# close up into solid knobs at 16 px, which keeps the gaps between them open.
|
||||
I["Settings"] = (gear(8,8,6.5,4.6,8,0.6,0.85)+" "+circ(8,8,1.7), None)
|
||||
I["About"] = (circ(8,8,6.5)+" M8 7 V11 M8 4.8 V5.2", None)
|
||||
I["Menu"] = ("M2.5 4 H13.5 M2.5 8 H13.5 M2.5 12 H13.5", None)
|
||||
I["Users"] = (circ(8,5,3)+" M2.5 14 A5.5 5.5 0 0 1 13.5 14", None)
|
||||
@@ -127,8 +142,12 @@ I["Cross"] = ("M4.5 4.5 L11.5 11.5 M11.5 4.5 L4.5 11.5", None)
|
||||
# Everything else (clocks, media controls, the ▶ rendered status, symmetric shapes) never mirrors.
|
||||
DIRECTIONAL = {"Back", "Forward", "ChevronLeft", "ChevronRight", "ExternalLink", "Jobs", "Logs", "ViewList"}
|
||||
|
||||
out = os.path.join(os.path.dirname(__file__), "..", "..", "src", "Chronos.Ui", "Icons", "Icons.xaml")
|
||||
with open(out, "w") as f:
|
||||
here = os.path.dirname(__file__)
|
||||
# UTF-8 with LF on every OS (the repository's .gitattributes), whatever the system code page.
|
||||
write = lambda path: open(path, "w", encoding="utf-8", newline="\n")
|
||||
|
||||
out = os.path.join(here, "..", "..", "src", "Chronos.Ui", "Icons", "Icons.xaml")
|
||||
with write(out) as f:
|
||||
f.write('<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"\n')
|
||||
f.write(' xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\n')
|
||||
f.write(' xmlns:ui="clr-namespace:Chronos.Ui.Controls">\n')
|
||||
@@ -154,5 +173,20 @@ for k, name in enumerate(names):
|
||||
svg.append('</g>')
|
||||
svg.append(f'<text x="{x+12}" y="{y+52}" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">{name}</text>')
|
||||
svg.append('</svg>')
|
||||
open(os.path.join(os.path.dirname(__file__), "icons.svg"), "w").write("\n".join(svg))
|
||||
print(len(I), "icons")
|
||||
with write(os.path.join(here, "icons.svg")) as f:
|
||||
f.write("\n".join(svg))
|
||||
|
||||
# The web admin's icons (its own names -> this set's), as inline SVG strings for app.js and the pages.
|
||||
WEB = {"dashboard": "Library", "users": "Users", "archive": "Archive", "jobs": "Jobs", "settings": "Settings", "logs": "Logs",
|
||||
"menu": "Menu", "power": "Power", "moon": "Moon", "refresh": "Refresh", "close": "Close", "plus": "Plus", "copy": "Copy",
|
||||
"search": "Search"}
|
||||
STROKE = 'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"'
|
||||
with write(os.path.join(here, "..", "..", "src", "Chronos.Server", "Admin", "web", "icons.js")) as f:
|
||||
f.write("// Generated by branding/ui-icons/icons.py (same 16-px set as the desktop apps). Do not edit by hand.\n")
|
||||
f.write("export const icons = {\n")
|
||||
for key, name in WEB.items():
|
||||
stroke, fill = I[name]
|
||||
paths = (f'<path d="{fill}" fill="currentColor"/>' if fill else "") + (f'<path d="{stroke}" {STROKE}/>' if stroke else "")
|
||||
f.write(f' {key}: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true">{paths}</svg>`,\n')
|
||||
f.write("};\n")
|
||||
print(len(I), "icons,", len(WEB), "web icons")
|
||||
@@ -310,7 +310,7 @@
|
||||
</g>
|
||||
<text x="499" y="556" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Server</text>
|
||||
<g transform="translate(577,504) scale(1.5)">
|
||||
<path d="M5.8 8 A2.2 2.2 0 1 0 10.2 8 A2.2 2.2 0 1 0 5.8 8 Z M8 1.5 V3.5 M8 12.5 V14.5 M1.5 8 H3.5 M12.5 8 H14.5 M3.4 3.4 L4.8 4.8 M11.2 11.2 L12.6 12.6 M3.4 12.6 L4.8 11.2 M11.2 4.8 L12.6 3.4" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M7.15 3.48 L7.4 1.53 A6.5 6.5 0 0 1 8.6 1.53 L8.85 3.48 A4.6 4.6 0 0 1 10.6 4.2 L12.15 3 A6.5 6.5 0 0 1 13 3.85 L11.8 5.4 A4.6 4.6 0 0 1 12.52 7.15 L14.47 7.4 A6.5 6.5 0 0 1 14.47 8.6 L12.52 8.85 A4.6 4.6 0 0 1 11.8 10.6 L13 12.15 A6.5 6.5 0 0 1 12.15 13 L10.6 11.8 A4.6 4.6 0 0 1 8.85 12.52 L8.6 14.47 A6.5 6.5 0 0 1 7.4 14.47 L7.15 12.52 A4.6 4.6 0 0 1 5.4 11.8 L3.85 13 A6.5 6.5 0 0 1 3 12.15 L4.2 10.6 A4.6 4.6 0 0 1 3.48 8.85 L1.53 8.6 A6.5 6.5 0 0 1 1.53 7.4 L3.48 7.15 A4.6 4.6 0 0 1 4.2 5.4 L3 3.85 A6.5 6.5 0 0 1 3.85 3 L5.4 4.2 A4.6 4.6 0 0 1 7.15 3.48 Z M6.3 8 A1.7 1.7 0 1 0 9.7 8 A1.7 1.7 0 1 0 6.3 8 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="589" y="556" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Settings</text>
|
||||
<g transform="translate(667,504) scale(1.5)">
|
||||
|
||||
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Reference in new issue
Block a user