diff --git a/scratch_toolpage.png b/scratch_toolpage.png new file mode 100644 index 0000000..2f37475 Binary files /dev/null and b/scratch_toolpage.png differ diff --git a/src/gui/components/_legacy.py b/src/gui/components/_legacy.py index 1e20581..cefcb25 100644 --- a/src/gui/components/_legacy.py +++ b/src/gui/components/_legacy.py @@ -1297,9 +1297,6 @@ _FAREWELL_SCRIPT_TEMPLATE = """ '

' + '__TITLE__

' + '

__SUBTITLE__

' + - '

' + - '__CLOSE_HINT__

' + ''; return overlay; } @@ -1328,20 +1325,19 @@ _FAREWELL_SCRIPT_TEMPLATE = """ try { win.location.replace('about:blank'); } catch (e) {} } function autoDismiss(doc, win) { - // Try the programmatic close first — succeeds in Chrome/Edge - // --app windows. If it fails (regular browser tab), surface the - // hint and auto-redirect to about:blank so the user lands on a - // clean page instead of the frozen farewell overlay. The "Close - // this window" button used to drive the same flow on click; we - // dropped that affordance per UX request, so this auto-timer is - // the only path on regular tabs. + // Try programmatic close first — succeeds in Chrome/Edge + // ``--app`` windows. If it fails (regular browser tab), + // auto-redirect to about:blank so the user lands on a clean + // page instead of the frozen farewell overlay. The "Close this + // window" button + the long browser-restriction hint paragraph + // both used to drive / explain this flow; we dropped both per + // UX request, so this auto-timer is the only path on regular + // tabs. var standalone = isStandalone(win); if (tryClose(win)) return; - var hint = doc.getElementById('datatools-close-hint'); - if (hint) hint.style.display = 'block'; setTimeout(function () { if (!win.closed) fallbackToBlank(win); - }, standalone ? 400 : 2500); + }, standalone ? 400 : 1500); } try { var doc = window.top.document; @@ -1383,8 +1379,6 @@ def _farewell_script() -> str: _FAREWELL_SCRIPT_TEMPLATE .replace("__TITLE__", _js_html_safe(_t("quit.farewell_title"))) .replace("__SUBTITLE__", _js_html_safe(_t("quit.farewell_subtitle"))) - .replace("__CLOSE_BTN__", _js_html_safe(_t("quit.close_window_button"))) - .replace("__CLOSE_HINT__", _js_html_safe(_t("quit.close_hint"))) ) @@ -2960,10 +2954,12 @@ def render_findings_panel( ) for i, f in sorted_findings: - _render_finding_row_v2(f, row_key=f"{ns}_{i}") + _render_finding_row_v2( + f, row_key=f"{ns}_{i}", filename=header, + ) -def _render_finding_row_v2(f, *, row_key: str) -> None: +def _render_finding_row_v2(f, *, row_key: str, filename: str = "") -> None: """One row inside the per-file findings card. Layout: severity chip (col 1) · title + meta (col 2) · "Open Tool" @@ -3025,6 +3021,18 @@ def _render_finding_row_v2(f, *, row_key: str) -> None: type="tertiary", width="content", ): + # Set the active file to the one this finding came from + # BEFORE switching pages — otherwise the tool page's + # ``pickup_or_upload`` reads the home page's "default to + # first imported file" state, losing the context of the + # card the user clicked. ``filename`` is the per-file + # findings group header. + home_uploads = st.session_state.get("home_uploads", {}) + meta = home_uploads.get(filename) if filename else None + if meta: + st.session_state["home_uploaded_name"] = filename + st.session_state["home_uploaded_size"] = meta["size"] + st.session_state["home_uploaded_bytes"] = meta["bytes"] st.switch_page(page_slug) body_html = f'

{title_html}

'