mirror of
https://github.com/MervinPraison/PraisonAIUI.git
synced 2026-11-07 05:56:17 -10:00
fix: preserve session in eval debug deep-link before navigating
The debug-run deep link only pushed the /runs?session= URL state in the traces fallback branch, dropping the session when a runs page exists. Push the URL state before navigating in both cases so Run Flight Recorder (STITCH-007) receives session context when it lands. Co-authored-by: Mervin Praison <[email protected]>
This commit is contained in:
1 parent
732bd123d8
commit
1170b264ee
2 files changed
+7
-7
No files matched your search
@@ -351,12 +351,12 @@ function wire(container, ordered, scores) {
|
||||
btn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
const session = btn.dataset.session;
|
||||
if (window.aiui?.selectPage && document.querySelector('[data-page="runs"], [data-nav="runs"]')) {
|
||||
navigate('runs');
|
||||
} else {
|
||||
try { history.pushState({}, '', `/runs?session=${encodeURIComponent(session)}`); } catch (err) { /* ignore */ }
|
||||
navigate('traces');
|
||||
}
|
||||
const hasRuns = window.aiui?.selectPage
|
||||
&& document.querySelector('[data-page="runs"], [data-nav="runs"]');
|
||||
try {
|
||||
history.pushState({}, '', `/runs?session=${encodeURIComponent(session)}`);
|
||||
} catch (err) { /* ignore */ }
|
||||
navigate(hasRuns ? 'runs' : 'traces');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ def test_cockpit_debug_link_falls_back_to_traces():
|
||||
src = _eval_source()
|
||||
assert "session_id" in src
|
||||
assert "/runs?session=" in src
|
||||
assert "navigate('traces')" in src
|
||||
assert "'traces'" in src
|
||||
|
||||
|
||||
def test_cockpit_escapes_case_content():
|
||||
|
||||
Reference in new issue
Block a user