Preserve S08 hash lifecycle while revealing linked SWOT tasks
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-10 18:17:13 +02:00
parent c790159250
commit 1c75a30a60
5 changed files with 104 additions and 10 deletions
+21 -10
View File
@@ -486,25 +486,36 @@ export default function InvestmentPath(path: Path) {
window.location.hash,
stageCodes.split(','),
);
if (
path.preparation_action &&
window.location.hash === '#tarefas'
) {
const target =
root.current.ownerDocument.getElementById('tarefas');
if (
target?.tagName === 'DETAILS' &&
root.current.contains(target)
) {
(target as HTMLDetailsElement).open = true;
target.scrollIntoView({ block: 'start' });
}
}
}
};
reveal();
window.addEventListener('hashchange', reveal);
return () => window.removeEventListener('hashchange', reveal);
}, [path.case.id, path.context_opportunity, stageCodes, path.next?.code]);
}, [
path.case.id,
path.context_opportunity,
stageCodes,
path.next?.code,
path.preparation_action?.id,
]);
const { auth, flash } = usePage<{
auth: { user: { id: number } };
flash: { success?: string };
}>().props;
useEffect(() => {
if (path.preparation_action && window.location.hash === '#tarefas') {
const target = document.getElementById('tarefas');
if (target instanceof HTMLDetailsElement) {
target.open = true;
target.scrollIntoView({ block: 'start' });
}
}
}, [path.preparation_action]);
const facts = useForm({
version: path.case.version,
context_opportunity: path.context_opportunity,