Skip to content

Dato Agent: give the inspector chat a usable starting width - #165

Closed
rodrigobarona wants to merge 1 commit into
datocms:masterfrom
rodrigobarona:fix/dato-agent-inspector-layout
Closed

rodrigobarona wants to merge 1 commit into
datocms:masterfrom
rodrigobarona:fix/dato-agent-inspector-layout

Conversation

@rodrigobarona

Copy link
Copy Markdown
Contributor

Closes #162

The Agent tab reserved all but 420px for the record pane. window.outerWidth is wider than the space DatoCMS actually has, so the chat opened as a narrow column beside an empty pane.

The inspector always shows that pane and only reads preferredWidth once, so this starts from a balanced split instead: the record pane takes about 45% of the window, and both panes keep at least 560px. The conversation is centered at 760px, and the empty pane explains that records open there and that the divider can be dragged.

Test plan

  • npm test in dato-agent
  • Open the Agent tab and confirm the chat is usable before any record is opened
  • Drag the divider and confirm a record still opens in the right-hand pane

Made with Cursor

The Agent tab reserved all but 420px for the record pane, so the chat opened as a narrow column beside an empty pane. Start from a balanced split, keep both panes usable, and center the conversation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@roger-datocms

Copy link
Copy Markdown
Member

(Claude here [Opus 5.5])

Triage

Status: still relevant. Master (6f57d960) still uses the old math in dato-agent/src/lib/inspectorLayout.ts. It keeps outerWidth - 420 for the record pane, so the chat opens as a thin column.

Assessment: the fix targets the right spot. preferredWidth sizes the right-hand record pane, and the CMS reads it once. A ~45% record share gives the chat room before any record opens.

Checks (PR head 3420804)

Review notes

  • inspectorLayout.ts:17-19: below 1120px the record pane gets half the window (400px at 800px). The old code kept a 550px record floor, labelled as the CMS minimum. Confirm the CMS accepts a narrower record pane, or clamps it.
  • window.outerWidth includes browser chrome and the CMS left nav. The real chat pane is narrower than outerWidth - record. The PR body says "both panes keep at least 560px"; that holds for the formula, not for real pixels. Acceptable, but worth knowing.
  • AgentSurface.module.css:488,1128: the 760px cap applies to every surface that renders AgentSurface, including the record sidebar. Sidebars are narrower than 760px, so this has no visible effect there.
  • No version bump or changelog entry. That matches how maintainers cut Dato Agent releases separately.

Next step

  1. Run the two unchecked manual items in the test plan on a real project.
  2. Check the 800px case against the CMS minimum record width.
  3. If both pass, merge. It closes Dato Agent: the Agent tab chat opens too narrow #162.

roger-datocms pushed a commit that referenced this pull request Oct 20, 2026
roger-datocms pushed a commit that referenced this pull request Oct 20, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
roger-datocms added a commit that referenced this pull request Nov 5, 2026
From #165 (Rodrigo's "usable starting width" PR), without its
starting-width logic, which the draggable, remembered width replaces:

- The empty record pane adds "Ask the agent to open a record and it
  appears in this pane. Drag the divider to resize it."
- The transcript and composer stop growing at 760px and stay centred,
  so a wide chat doesn't make very long lines.

Co-authored-by: Rodrigo Barona <rodrigo.barona@wundermanthompson.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roger-datocms

Copy link
Copy Markdown
Member

I had to make a few conflicting edits, but I rolled these into #174. Currently making a few more fixes and then will try to deploy a new version soon.

Thanks again for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dato Agent: the Agent tab chat opens too narrow

2 participants