From ee19343697846cf0f306212de8eb778f641283e0 Mon Sep 17 00:00:00 2001 From: Albrecht Degering Date: Tue, 4 Aug 2026 08:21:50 +0200 Subject: [PATCH] Adopt compact shared workspace feedback --- docs/INTERFACE_PATTERN_MIGRATION.md | 3 +++ webui/src/features/voting/VotingPage.tsx | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/INTERFACE_PATTERN_MIGRATION.md b/docs/INTERFACE_PATTERN_MIGRATION.md index 18e31d2..7f116a1 100644 --- a/docs/INTERFACE_PATTERN_MIGRATION.md +++ b/docs/INTERFACE_PATTERN_MIGRATION.md @@ -25,6 +25,9 @@ assurance profiles. Challenge and annulment append reasoned events and erase nothing. - Missing permission or electorate membership identifies the required action, responsible actor, and destination. +- Electorate matching and new-ballot defaults use the canonical authenticated + principal account ID, falling back to the shell user's account ID when the + richer principal context has not loaded yet. - Optional Committee, Decision, Encryption, Forms, Trust, Policy, Reporting, and Workflow integrations remain behind declared contracts. diff --git a/webui/src/features/voting/VotingPage.tsx b/webui/src/features/voting/VotingPage.tsx index da0b681..b4c2a53 100644 --- a/webui/src/features/voting/VotingPage.tsx +++ b/webui/src/features/voting/VotingPage.tsx @@ -52,6 +52,7 @@ export default function VotingPage({ settings, auth }: PlatformRouteContext) { const canCast = hasScope(auth, "voting:ballot:cast"); const canCertify = hasScope(auth, "voting:ballot:certify"); const canAdmin = hasScope(auth, "voting:ballot:admin"); + const currentAccountId = auth.principal?.account_id || auth.user.account_id; const loadList = useCallback(async (signal?: AbortSignal, preferredId?: string) => { setLoading(true); @@ -94,8 +95,8 @@ export default function VotingPage({ settings, auth }: PlatformRouteContext) { }, [selectedId, settings]); const eligible = useMemo(() => Boolean( - selected?.electorate.some((item) => item.subject_id === auth.account.id) - ), [auth.account.id, selected]); + selected?.electorate.some((item) => item.subject_id === currentAccountId) + ), [currentAccountId, selected]); async function run(action: "open" | "close" | "certify") { if (!selected) return; @@ -240,7 +241,7 @@ export default function VotingPage({ settings, auth }: PlatformRouteContext) { open settings={settings} ballot={editing === "new" ? null : editing} - currentAccountId={auth.account.id} + currentAccountId={currentAccountId} onClose={() => setEditing(null)} onSaved={(ballot) => { setEditing(null);