Fix/download output#1445
Merged
Merged
Conversation
Reintroduce the ellipsis menu next to the output tabs on session results in Audit, Webclient and Runbooks. The menu offers TXT for any output and adds CSV/JSON for tabular SQL connections. Downloads under 2MB are built client-side from the already-loaded payload; larger payloads (or sessions flagged as has-large-payload) fall back to the existing backend token flow via /sessions/:id?extension=, keeping the 4MB threshold behaviour intact. Unifies the separate "Download" button that lived in the session header for >4MB payloads into the same menu so users see a single, predictable entry point in every results surface.
Drop the custom hover/class overrides on DropdownMenu.Item so each entry inherits Radix's built-in hover state, matching the existing webclient output menu in log_area/logs.cljs. Each item now wraps its icon and label in a Flex with a Text component, mirroring the project pattern. Center-align the tabs row in audit results and webclient log area so the ellipsis trigger sits on the same baseline as the tab text instead of floating at the bottom.
Add a :gateway->sessions-download-disabled? subscription that reads disable_sessions_download from /serverinfo, and gate the results download menu on it. Without this gate the client-side blob path (< 2MB) bypassed the policy entirely; the backend already rejects the large-payload path with 403 at session.go:493 but the user would still see a snackbar error instead of a hidden action. Also hide the input-script download button in large-input-warning when the policy is on, since that flow shares the same backend endpoint.
…primitives Inside the audit session-details modal the dropdown items had no hover and no cursor change because Radix Dialog's focus trap fights with DropdownMenu's default modal focus management. Set :modal false on DropdownMenu.Root and restore the cursor-pointer / hover:bg-gray-2 classes used by the existing Approve dropdown in session_details.cljs, which is the proven pattern for in-modal dropdowns in this codebase. Also replace the raw :div elements I introduced in results-container with Radix Box and Flex to follow the project's component conventions.
Contributor
Migration Safety AnalysisNo database migrations were changed in this PR. Safe to deploy to sandbox. |
Contributor
|
✅ Build Completed with Success, Version=1445.0.0-aed70d5 |
luanlorenzo
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
The ellipsis menu for downloading session results had disappeared from the frontend. This PR restores it and unifies all download entry points into a single, reusable component used by Audit session details, the Webclient log area, and the Runbooks runner.
The menu offers TXT for any output and additionally CSV / JSON when the connection produces tabular output. Downloads under 2MB are generated client-side from the already-loaded payload; larger payloads (or sessions flagged with
has-large-payload?) fall back to the existing backend token flow, keeping the 4MB threshold behavior intact.The standalone "Download" button that previously lived in the session header for >4MB payloads has been removed, so users now see a single predictable entry point on every results surface.
It also honors the existing
DISABLE_SESSIONS_DOWNLOADserver policy: the menu (and the input-script download button in the large-input warning) are hidden when the policy is on, preventing the client-side path from bypassing the rule that the backend enforces atsession.go:493.🔗 Related Issue
Fixes #
🚀 Type of Change
📋 Changes Made
webapp.components.results-download-menucomponent built on RadixDropdownMenu, offering TXT (always) and CSV/JSON (for tabular outputs). Uses a 2MB threshold to decide between client-side blob generation (viapapaparse'sunparsefor CSV) and the existing backend token flow (:audit->session-file-generate).webapp.audit.views.results-containerso it appears next to the Plain text / Table tabs on session details.webapp.webclient.log-area.main, which automatically covers both the Webclient editor output and the Runbooks runner.webapp.sessions.components.session-headerand dropped the now-unused:has-large-payload?/:download-extensionprops at the call site, unifying every download entry point into the ellipsis menu.:gateway->sessions-download-disabled?inwebapp.events.gateway-infothat readsdisable_sessions_downloadfrom/serverinfo, and used it to hide the menu and thelarge-input-warningdownload button whenDISABLE_SESSIONS_DOWNLOAD=true.hover:bg-gray-2classes onDropdownMenu.Itemso each entry inherits the default Radix hover styling, matchingwebapp.webclient.log-area.logs.🧪 Testing
Test Configuration:
Tests performed:
Manual scenarios to validate:
{connection}-{sid}-{timestamp}.{ext}.has-large-payload?(>4MB): menu falls back to the backend token endpoint and opens the temporary download URL.DISABLE_SESSIONS_DOWNLOAD=trueon the gateway: the ellipsis menu no longer renders, and the input-script "Download" button in the large-input warning is hidden.DISABLE_CLIPBOARD_COPY_CUT=true: download menu is unaffected (separate policy, by design).📸 Screenshots (if applicable)
✅ Checklist
make generate-openapi-docsto update the OpenAPI docs (not applicable — frontend-only change, no API surface modified)📄 Additional Notes
repo.clojars.org, sonpx shadow-cljs compile hoop-uicould not downloadthheller:shadow-cljs:2.28.14and the build was not executed end-to-end. Manual review confirmed every JS/Radix/lucide symbol used (DropdownMenu,IconButton,Flex,Text,MoreHorizontal,FileText,Sheet,Braces,papa/unparse) is exported by the locked versions inpackage.json. Please runnpm run dev:hoop-uilocally to confirm.papa.unparseof the matrix already shown in the Table tab) and the backend CSV path (parseBlobStreamwithwithCsvFmt: true) — they use different parsers, so a >2MB SQL session may produce a slightly different CSV than a small one. If exact parity is required we should consider routing all CSV through the backend.DISABLE_CLIPBOARD_COPY_CUTandDISABLE_SESSIONS_DOWNLOAD) are kept independent on purpose, matching the existing codebase convention.