mavweb: unify UI — shared ui.css + nav partial across all pages

One theme (the PWA's dark palette) for dash/history/trace/notifications/
tools/passkey via static/ui.css; shared nav template with active-page
highlight; tables wrapped in .scroll so they pan on phones; PWA nav no
longer clips the RU/EN toggle; dash 'updated' timestamp fixed (selector
matched nothing). AGENTS.md documents the local preview/screenshot recipe.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ASstMtsZWLSRcD1Tq8T68Q
This commit is contained in:
kami
2026-07-05 18:36:31 +04:00
parent a158ffd1d2
commit d7c0cf89d3
9 changed files with 215 additions and 158 deletions
+15 -32
View File
@@ -1,43 +1,24 @@
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<!doctype html><meta charset=utf-8>
<meta name=viewport content="width=device-width,initial-scale=1">
<title>maven · history</title>
<style>
body{font:14px system-ui;margin:1.5rem;max-width:70rem}
h1{font-size:1.3rem;margin-bottom:.3rem}
nav a{margin-right:1rem}
table{border-collapse:collapse;width:100%;margin-top:.5rem}
th,td{border:1px solid #ccc;padding:.3rem .5rem;text-align:left;vertical-align:top}
th{background:#f6f6f6}
.voided{opacity:.45;text-decoration:line-through}
.void-badge{color:#999;font-size:.8rem;margin-left:.3rem}
.key{font-family:monospace;white-space:nowrap}
.val{font-family:monospace;word-break:break-all;max-width:20rem}
.src{font-size:.85rem;color:#666}
.count{color:#888;font-size:.85rem;margin-top:.3rem}
.revert-btn{font-size:.8rem;padding:.15rem .4rem;cursor:pointer}
.revert-btn:disabled{opacity:.4;cursor:not-allowed}
#msg{margin-top:.5rem;padding:.4rem;border-radius:.3rem;display:none}
.msg-ok{background:#e6ffed;display:block!important}
.msg-err{background:#ffe6e6;display:block!important}
</style>
<h1>maven · command history</h1>
<nav><a href=/dash>dash</a> <a href=/tools>tools</a> <a href=/auth/passkey>passkey</a> <a href=/notifications>notifications</a></nav>
<p class=count>{{len .Facts}} facts shown (newest first)</p>
<div id=msg></div>
<table>
<link rel=stylesheet href=/ui.css>
<style>.val{word-break:break-all;max-width:20rem}</style>
{{template "nav" "history"}}
<h1>command history</h1>
<p class=muted>{{len .Facts}} facts shown (newest first)</p>
<div id=msg class=msg hidden></div>
<div class=scroll><table class=mono>
<tr><th>when<th>kind<th>key<th>value<th>source<th>conf<th></tr>
{{range .Facts}}{{if .VoidsID}}<tr class=voided>{{else}}<tr>{{end}}
<td>{{if .VoidsID}}<span class=void-badge> voided</span>{{end}}{{.Ts.Format "2006-01-02 15:04"}}</td>
<td>{{.Kind}}</td>
<td class=key>{{.Key}}</td>
<td class=val>{{.Value}}</td>
<td class=src>{{.Source}}</td>
<td class=muted>{{.Source}}</td>
<td>{{printf "%.2f" .Confidence}}</td>
<td>{{if not .VoidsID}}<button class=revert-btn onclick="revert('{{.Key}}',this)">revert</button>{{end}}</td>
<td>{{if not .VoidsID}}<button onclick="revert('{{.Key}}',this)">revert</button>{{end}}</td>
</tr>{{end}}
</table>
</table></div>
<script>
const msg=document.getElementById('msg');
function revert(key,btn){
@@ -45,11 +26,13 @@ function revert(key,btn){
fetch('/api/revert',{method:'POST',headers:{'content-type':'application/x-www-form-urlencoded'},body:'key='+encodeURIComponent(key)})
.then(r=>r.json().then(d=>({ok:r.ok,data:d})))
.then(({ok,data})=>{
msg.className=ok?'msg-ok':'msg-err';
msg.className=ok?'msg msg-ok':'msg msg-err';
msg.hidden=false;
msg.textContent=ok?'reverted ✓':(data.error||'revert failed');
if(ok) btn.closest('tr').className='voided';
}).catch(e=>{
msg.className='msg-err';
msg.className='msg msg-err';
msg.hidden=false;
msg.textContent='error: '+e;
btn.disabled=false;
});