Skip to content

fix(stml): preserve content when rows cannot fit - #787

Open
benvinegar wants to merge 1 commit into
mainfrom
fix/stml-row-layout-invariants
Open

fix(stml): preserve content when rows cannot fit#787
benvinegar wants to merge 1 commit into
mainfrom
fix/stml-row-layout-invariants

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Summary

  • stack STML row children when declared fixed widths plus minimum flex widths cannot fit
  • preserve loose inline content above rows that fall back to vertical stacking
  • cover both regressions with adversarial width and mixed-content tests

Testing

  • bun test src/ui/lib/stml src/ui/lib/agentNoteGeometry.test.ts src/ui/fileViews/geometry.test.ts src/ui/components/ui-components.test.tsx src/ui/hooks/useTerminalReview.test.tsx — 187 passed
  • bun run typecheck
  • bun run lint
  • bun run check:pack
  • bun run test:integration — 117 passed
  • bun run test:tty-smoke — 9 passed
  • real-TTY source-diff smoke run

A full bun test completed 3,042 tests successfully; its only failures were the two existing website Playwright specs being discovered by Bun's test runner.

This PR description was generated by Pi using gpt-5.6-sol

@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hunk-web Ignored Ignored Aug 16, 2026 10:08pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes STML row fallback behavior when declared fixed widths and minimum flex widths cannot fit.

  • Detects overcommitted rows using their fixed-width and minimum flex requirements.
  • Preserves loose inline content when row children stack vertically.
  • Adds regression coverage for width constraints and mixed-content fallback.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The revised fit check prevents overcommitted horizontal allocation, while the fallback constrains stacked children to the row width and now retains loose inline content.

Important Files Changed

Filename Overview
src/ui/lib/stml/layout.ts Correctly detects overcommitted rows, preserves inline content during fallback, and keeps horizontal allocations within the requested width.
src/ui/lib/stml/layout.test.ts Adds focused regression tests for fixed-width overflow and preservation of loose inline text during stacking.
.changeset/tidy-rows-stack.md Accurately documents the patch-level STML layout fix.

Reviews (1): Last reviewed commit: "fix(stml): preserve content when rows ca..." | Re-trigger Greptile

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.

1 participant