Show a link to debug.log in the agentic UI when the file exists - #4761
Conversation
📊 Performance Test ResultsComparing 40d892e vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
|
Tested in the browser UI, works as described, and the code is clean: both connectors covered, good wire-contract tests. 👍 One edge case worth a look: when the user unchecks the toggle and saves, the query is disabled but React Query keeps the cached true, so the Open log file button stays visible until a reload. Minor nits, take or leave:
A few things maybe worth cutting/removing from the PR to keep things lean:
|
…o-debuglog-when-it-exists-in-the-agentic-ui # Conflicts: # apps/ui/src/components/site-settings-view/index.tsx
|
@youknowriad thanks for review. I fixed the query so it depends only on whether the file exists - this also means the button now shows for sites that have a debug.log but logging turned off, what is consistent with classic UI. I also applied a few proposed cleanup and quality things. |
Related issues
How AI was used in this PR
Claude Code wrote the implementation and tests, and drove the browser verification below. I reviewed the diff, directed the button styling and other improvements.
Proposed Changes
Studio Classic offers an Open log file link in site Settings once a site has actually written a
wp-content/debug.log. The agentic UI had the Enable debug log toggle but no way to get to the file it produces, so you had to go find it in the site folder yourself. This ports that shortcut, as a button under the toggle, matching the mockup on the issue.Testing Instructions
Browser UI:
npm run cli:build:ui && node apps/cli/dist/cli/main.mjs ui --no-openThen at http://localhost:8081 → a site → Settings → Debugging. Repeat the same steps on the desktop app (
npm start) — both front ends are in scope.wp-content/debug.log, there's no button.rm wp-content/debug.log, then navigate to another site and back — the button is gone. Restore the file and it returns.Pre-merge Checklist