Fix sidebar username, Signals filter clarity and layout
Deploy / lint (push) Successful in 7s
Deploy / test (push) Successful in 35s
Deploy / deploy (push) Successful in 24s

- JWT now carries a username claim; sidebar shows "Signed in as <name>"
  instead of the bare user id (sub). Re-login required for the new claim.
- Signals: Min R:R / Min Confidence inputs reflect the effective filter —
  auto-filled from the activation gate when "Qualified only" is on, reset
  to 0 when off (no more misleading 0 while the gate is active).
- Signals layout: Run Scanner moved to its own action row (it's a job
  trigger, not a filter); qualified toggle grouped with the refinement
  filters under one Filters panel.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 12:11:39 +02:00
parent 33f6baca6b
commit 5a0e8c8258
11 changed files with 178 additions and 125 deletions
+4 -3
View File
@@ -8,7 +8,7 @@ export interface AuthState {
logout: () => void;
}
function decodeJwtPayload(token: string): { sub?: string; role?: string } {
function decodeJwtPayload(token: string): { sub?: string; username?: string; role?: string } {
try {
const base64 = token.split('.')[1];
const json = atob(base64);
@@ -23,7 +23,8 @@ export const useAuthStore = create<AuthState>()((set) => ({
username: (() => {
const t = localStorage.getItem('token');
if (!t) return null;
return decodeJwtPayload(t).sub ?? null;
const p = decodeJwtPayload(t);
return p.username ?? p.sub ?? null;
})(),
role: (() => {
const t = localStorage.getItem('token');
@@ -37,7 +38,7 @@ export const useAuthStore = create<AuthState>()((set) => ({
localStorage.setItem('token', token);
set({
token,
username: payload.sub ?? null,
username: payload.username ?? payload.sub ?? null,
role: payload.role === 'admin' ? 'admin' : 'user',
});
},