Repository navigation
Description
Summary
When a user double-clicks a truncated cell value to open the full-content viewer (CellViewerModal), the modal's content area appears empty/clipped — only the header (column name + type badge + character count) and the footer (Download / Copy / Close buttons) are visible. The actual value is not rendered inside the modal, even though the modal is opened correctly and metadata like 61 characters is shown.
Steps to reproduce
- Run a query returning a long value (e.g. a TEXT column with 60+ characters)
- Double-click the truncated cell to open the viewer
- Modal opens showing the column name (
title), type badge (TEXT), character count (61 characters), and the bottom action bar - Expected: the value text is visible in the middle content area
- Actual: the middle area is blank; only the metadata header and button row render
Screenshot
Attached by reporter. The middle band between the metadata header and the Download/Copy/Close footer is empty.
Root cause
The Monaco-based viewer is rendered inside a doubly-overflow-hidden container in src/components/grid/CellViewerModal.tsx:238-275:
<div className="min-h-0 flex-1 p-4"> // line 238 — flex-1 fills the available height
<div className="h-full overflow-hidden rounded border ..."> // line 239 — h-full + overflow-hidden wrapper
<Editor
height="100%"
language={language}
value={viewerContent} // line 250 — the actual value
onMount={onMount}
...
options={{ ..., automaticLayout: true, ... }} // line 268
/>
</div>
</div>Two layered issues combine to produce the blank render:
-
Monaco inside nested
overflow-hiddencontainers fails to size correctly on cold mount. Monaco measures its container to compute its layout; when wrapped in an outeroverflow-hidden(line 239) that is itself inside another overflow-managed parent (line 238'sflex-1+ the modal's overalloverflow-hidden), Monaco can initialize with a 0×0 or stale box, leaving the rendered text invisible until the next resize event.automaticLayout: truehelps, but is not always sufficient when the container chain contains multipleoverflow-hiddenlayers. -
No
keyon<Editor>forces re-init per open. The<Editor>is mounted once whenCellViewerModalfirst mounts. Subsequent openings of the modal with new content reuse the same Monaco instance. When the value changes fromnull→61-char string→ another value, Monaco's internal model updates but the rendered viewport may stay blank if Monaco's layout hadn't fully recovered from the prior 0-size measurement.
Proposed fix
src/components/grid/CellViewerModal.tsx:238-275 — try the following changes in order (each is independent; the first alone may be sufficient):
1. Force Monaco re-init per open
Add a key to <Editor> that changes when the displayed content changes:
<Editor
key={`${columnName}-${displayContent?.length ?? 0}`}
height="100%"
...
/>This guarantees a fresh Monaco instance each time the viewer opens with different content, eliminating any stale-layout state.
2. Remove the redundant overflow-hidden wrapper
Drop the wrapper <div className="h-full overflow-hidden rounded border ..."> at line 239 — give those classes to the Monaco host instead, or use <div className="flex-1 min-h-0 rounded border ..."> so Monaco's own internal scrolling works without competing with an outer clip context.
3. Ensure the Monaco container has an explicit width
Monaco's default width: 100% requires its parent to have a determined width. Inside the modal flex column the width is computed correctly, but if step 2 changes the wrapper, double-check that the Monaco host has w-full (or that its parent flex chain still resolves width).
Verification
- Run a query with a long value (≥60 chars)
- Double-click the cell — value text should appear immediately in the modal
- Close the modal, double-click a different cell with a different long value — text should appear immediately
- Open a value, edit it, save — re-open the same cell — value should still render
- Open a
NULLcell —NULLplaceholder text should render (regression check on the conditional at line 240)
Out of scope
- Replacing Monaco with
<pre>/<textarea>(Monaco gives syntax highlighting for JSON/SQL/markdown and is intentionally the viewer — the fix is layout, not a rewrite) - Changing the modal's header / footer (working as designed)
- Adjusting the modal's overall size or position
Files
src/components/grid/CellViewerModal.tsx:238-275— content areasrc/components/grid/CellViewerModal.tsx:109—viewerContentderivation (verify the value chaincontentprop →displayContent→formattedContent→viewerContentis intact)
Activity
fix(grid): give the cell viewer somewhere to draw the cell (#721)