fix(ui): adjust docx and code rendering#4334
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview The Monaco text editor configuration is tightened to suppress suggestion UI (quick suggestions, trigger-based suggestions, word-based suggestions, hovers, parameter hints, codelens, lightbulb, and inlay hints) to avoid noisy tooltips during code generation/editing. Reviewed by Cursor Bugbot for commit 33851c3. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR fixes two UI rendering issues: DOCX files now scale to fit their container using CSS transforms with a Confidence Score: 4/5Safe to merge — both changes are well-scoped UI fixes with no data or security risk. Only P2 style/robustness findings: a hardcoded library-internal padding constant and an inline type cast for a Monaco enum. No logic errors or regressions identified. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[DocxPreview mounts] --> B[useEffect: ResizeObserver setup]
B --> C[Observe containerRef]
A --> D[useEffect: fileData rendered]
A --> E[useEffect: streamingContent rendered]
D --> F[renderAsync docx-preview lib]
E --> G[fetch /api/docx/preview]
G --> H[renderAsync docx-preview lib]
F --> I[applyPostRenderStyling]
H --> I
I --> J[set background transparent]
I --> K[set box-shadow on pages]
I --> L[fitDocxToContainer]
C --> |container resizes| L
L --> M{naturalPageWidth?}
M -- no --> N[return early]
M -- yes --> O{scale >= 1?}
O -- yes --> P[reset styles only, return]
O -- no --> Q[apply CSS scale + negative margins to wrapper]
Reviews (1): Last reviewed commit: "fix(ui): adjust docx and code rendering" | Re-trigger Greptile |
Use computed padding from `.docx-wrapper` instead of a hardcoded 60px so the fit calculation survives docx-preview library changes. Replace the inline `import()` cast for ShowLightbulbIconMode with a top-level type import. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Code generation was creating tooltips which are kinda overkill and word documents didn't respect container width sizing.
Fixed both.
Type of Change
Testing
Checklist
Screenshots/Videos