Repository navigation
Conversation
The server-rendered fallback loads Tailwind, Turbo and Stimulus from CDNs, so expanding a trace needs a network and JavaScript. Ship small console-scoped styles and use native details with standalone links. Make refresh opt-in through bounded HTML refresh intervals, preserving filters without interpreting query parameters as routing options. Cover list, detail, metrics, empty states and escaped trace contents. Refs activeagents#384
The self-hosted observability guide and the generated initializer still said the trace console loads Tailwind, Turbo and Stimulus from CDNs and recommended a custom layout to avoid them. Neither is true any longer, and a custom layout now drops the console's built-in styles.
|
Thanks @yorzi — this looks good to me. Dropping the CDN Tailwind/Turbo/Stimulus from the console layout is the right call for a page whose whole selling point is "no JavaScript", and moving the expand to native Before I merge: would you like a full review pass on this, or are you comfortable with it going in as-is? Also — you noted the 500-row cap, the dark-mode |
Refs #384. This covers only the "console CDN deps" finding. The 500-row cap, the dark-mode TracesView gaps and the
tool_usagekey drift are separate and stay open.The routes describe the server-rendered console (
<mount>/console/traces) as "Same data, no JavaScript — useful when the bundle can't run". Its layout, however, loaded Tailwind fromcdn.tailwindcss.comand Turbo and Stimulus fromunpkg.com. Offline, on an air-gapped network or behind a strict CSP, the console rendered unstyled. Its trace rows expanded through a Stimulus controller, so a trace's details could not be opened at all.What changes
layouts/action_agent/application.html.erb: no scripts and no external stylesheets. Styles come from a console-scoped inline partial (traces/_styles.html.erb), with light and dark tokens and a narrow-screen layout.traces/index.html.erb: each trace is a native<details>with an Open trace link to the standalonetraces#showpage. Expanding a trace needs no JavaScript.traces/_summary.html.erb(new): the 24-hour summary tiles are shared by index and metrics instead of being duplicated.traces/show,_trace_detail,metrics: rewritten with semantic markup (dl,tablewith scoped headers,sectionlabels) and no Tailwind classes. The span timeline keeps the same offset math.?refresh=30,?refresh=60is also accepted, and either one renders<meta http-equiv="refresh">. The controller accepts only"30"and"60", so the value can't carry aurl=. The refresh links are built fromrequest.pathplus the query string, neverurl_for(params), sohostorscript_namein the query cannot redirect them. Existing filters such asstatus=errorare kept.config.layoutcomment.Behaviour notes
ActionAgent.layout(the old initializer comment recommended this for CSP-strict setups) replaces the engine layout, which now carries the console's styles and refresh controls. Such hosts can drop the setting, and the initializer comment says so.style-srclacks'unsafe-inline', the inline<style>and the span bars'styleattributes are still blocked. That is unchanged from before. Supporting a nonce would be a follow-up.Checks
actionagent/test/trace_console_test.rb(new, 4 tests): noscript, stylesheetlinkordata-controlleron list, detail and metrics pages; native details with a standalone link; escaped error text; opt-in refresh limited to 30 and 60, with0,-1,1;url=https://example.comandabcrejected; filters kept; empty states. With main's views restored, 3 of 4 fail. Removing the 30/60 check fails the refresh test.document,favicon). The page is styled, and a trace expands with its span timeline.bin/test: 4096 runs, 0 failures, 0 errors (the docs follow-up commit changes no code; the install generator tests still pass).bin/rubocopreports no offenses.🤖 Generated with Claude Code