Gravatar avatars are now behind SIMPLEAUDIT_GRAVATAR (default off); when off,
no gravatar.com URL is rendered and templates show the user's initial. The
visualizer sidebar uses the same helper. The Tailwind Play CDN script is pinned
to 3.4.17, the version cdn.tailwindcss.com currently redirects to.
26 days ago
fix(visualizer): bounded incremental file discovery + fix test gRPC hang
The visualizer file-tree scan (GET /api/visualizer/api/files/) performed an
unbounded os.walk over the results directory, parsing every JSON file with no
limits. When --results_dir resolved to a large tree (e.g. $HOME), the scan
took minutes and the browser fetch stayed pending forever.
Bounded scan (infra/visualizer.py):
- Limits: 5,000 inspected JSON files, 5s budget, depth 8, 100 MB/file —
enforced during traversal, not afterward.
- Partial results with truncated/reason/inspected/elapsed_seconds metadata;
never reports a truncated tree as complete.
- Persistent metadata index (~/.simpleaudit-studio/visualizer-index.json)
keyed by (path, mtime, size) — unchanged files are not re-parsed.
- watchfiles for incremental updates via /api/visualizer/api/files/changed/.
- Frontend shows a truncation warning banner and polls the changed endpoint.
- CLI warns when results dir is home/cwd and displays scan limits.
Test fix (infra/tests/test_api_e2e.py):
- Mock audits.views.submit_audit_…
Moved the SimpleAudit logo from the right side to the left side of the
'Visualizer' title in the header for better visual hierarchy and branding.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
feat: add logo to visualizer header next to title
Added the SimpleAudit logo icon to the right of the 'Visualizer' title in the
header for better branding consistency. The sidebar already has the logo and
it remains visible even when the sidebar is collapsed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix: prevent auto-close when clicking sidebar toggle button
The auto-close feature was triggering when clicking the hamburger menu button
because the button is inside the main content area. Now the auto-close handler
checks if the click target is the toggle button and skips auto-close in that case.
Also replaced inline onclick with addEventListener for better reliability.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
feat: add auto-close sidebar on main content click, remove collapse button
- Added auto-close behavior for mobile sidebar drawer when clicking on main content
- Removed the manual collapse button from the bottom of the sidebar
- Kept the X button for mobile and hamburger menu for desktop
- Applied consistently across all pages (base.html, sidebar.html, visualizer_sidebar.html)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix: hide detail view on mobile until scenario selected
On mobile (<768px), the detail view was visible below the scenario list
even when no scenario was selected. Now:
- Detail view is hidden by default on mobile
- Detail view appears as full-screen overlay when scenario selected
- 'Back to list' button returns to list view
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix: remove double-encoding in URL case parameter
URLSearchParams.set() already encodes values, so calling
encodeURIComponent() first caused double-encoding of forward
slashes (/ became %252F instead of %2F).
Fixed in two places:
- loadJsonFile() function
- renderDetail() function
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
feat: visualizer-style header in base template + sidebar improvements
- Use visualizer-style header (h-12, hamburger, title, subtitle) in base.html
- Header is now always visible (not just mobile)
- Hamburger toggles collapse on desktop, drawer on mobile
- Added header_subtitle and header_actions template blocks
- Visualizer sidebar: file tree, refresh, download, collapse
- Collapsed sidebar: click file tree only expands, doesn't load files
- Favicon, logo, and styling inherited from Studio
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rename 'Browse local folder' to 'Open Folder' in Open menu
The two separate buttons were redundant. Now a single 'Open' dropdown
button offers both options:
- Upload JSON file (single file, all browsers)
- Browse local folder (File System Access API, Chromium only)
The folder option is hidden in browsers without showDirectoryPicker.
Menu closes on outside click.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add Local badge to JSON Files header for Browse Folder
When a local folder is browsed via the File System Access API, a small
'Local' badge appears next to the 'JSON Files' header. Hovering the
badge shows the selected folder name. The badge is hidden when the
server-side file tree is loaded (e.g. via the refresh button).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Show selected folder name in Browse Folder, remove alert
- Remove the 'No .json files found' alert — instead show the folder
name header and a subtle 'No SimpleAudit result files found' message
in the sidebar when the folder has no audit results
- Nested folders with audit files are still shown in the tree
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Filter Browse Folder to show only SimpleAudit result files
The Browse Folder feature previously showed all .json files in the
selected folder. Now it validates each file against the same audit-data
shape check the server-side visualizer uses (is_valid_audit_data), so
only SimpleAudit result files and experiment files appear in the tree.
- Added looksLikeAuditResult, localExperimentModels, isValidAuditData
JS helpers mirroring the server-side Python logic
- buildLocalDirTree now reads and validates each .json before including it
- Experiment files render as expandable folders with model pickers
(same as server-side), reading from the local file handle
- Non-audit JSON files are silently skipped
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add Browse Folder button to visualizer (File System Access API)
Adds a 'Browse Folder' button next to 'Upload JSON' in the visualizer
page. Uses window.showDirectoryPicker() to let the user pick a local
folder, recursively walks it for .json files, and renders them as a
local file tree in the sidebar. Clicking a file reads it via
handle.getFile() and renders it client-side — no server round-trip.
- Button is hidden in browsers without showDirectoryPicker (Firefox, Safari)
- No server changes; fully client-side
- Local files skip the 'Download as standalone HTML' button (no server path)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
feat(visualizer): absorb SimpleAudit result visualizer into Studio
Port the single-file HTML viewer (formerly `simpleaudit serve` /
`export-html` in the core) into Studio as Django views plus two
self-contained static assets.
- infra/visualizer.py: file-tree, JSON/image APIs, standalone HTML export,
and the /visualizer/ + /visualizer/upload/ SPA pages
- config/urls.py: routes for the SPA and its APIs. The SPA hardcodes
"/api/*" fetch paths prefixed by __VISUALIZER_API_BASE, so the API routes
live under /api/visualizer/api/* to match
- simpleaudit_studio/cli.py: --results_dir + --visualize-only to browse a
folder of dumped results server-side
- templates: export-html entry points on run detail/result and compare
- tests: cover shape detection, file tree, JSON/image endpoints, path
traversal, login gating, and standalone export
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>