feat(framework-editor): resizable + size-remembering description editor (FRAME-3)#3125
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
cubic analysis
2 issues found across 4 files
Confidence score: 3/5
- In
apps/framework-editor/app/components/table/EditableCell.tsx, the free vertical resize can grow past the viewport with no dialog height cap/scroll area, which can push Save/Cancel off-screen and block users from completing edits — add a max-height and internal scrolling before merging. - In
apps/framework-editor/app/components/table/EditableCell.tsx, size persistence useslocalStorageinstead of the cookie mechanism requested in FRAME-3, so behavior will diverge from the agreed requirement — switch persistence to cookies (or align product expectations) before merge.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/framework-editor/app/components/table/EditableCell.tsx">
<violation number="1" location="apps/framework-editor/app/components/table/EditableCell.tsx:14">
P3: According to linked Linear issue FRAME-3, the remembered size must be stored in a cookie. This implementation persists via localStorage instead, so it doesn’t meet the requested persistence mechanism.</violation>
</file>
Linked issue analysis
Linked issue: FRAME-3: Framework Editor - re-sizing widget changes
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | Editor can be resized horizontally and vertically (not just vertically) | Textarea and dialog classes were changed to allow horizontal growth (resize enabled, min/max widths, dialog uses w-fit/max-w), so horizontal dragging can change width. |
| ✅ | Persist the editor size and restore it when reopening (issue said cookie) | A storage helper was added and used: sizes are validated, saved, and loaded. The PR uses localStorage (not a cookie) but achieves the expected persistent restore behavior; tests cover storage and reopen behavior. |
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| import { Maximize2 } from 'lucide-react'; | ||
| import { useState } from 'react'; | ||
| import { useRef, useState } from 'react'; | ||
| import { loadEditorSize, saveEditorSize, type EditorSize } from './editor-size-storage'; |
There was a problem hiding this comment.
P3: According to linked Linear issue FRAME-3, the remembered size must be stored in a cookie. This implementation persists via localStorage instead, so it doesn’t meet the requested persistence mechanism.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/framework-editor/app/components/table/EditableCell.tsx, line 14:
<comment>According to linked Linear issue FRAME-3, the remembered size must be stored in a cookie. This implementation persists via localStorage instead, so it doesn’t meet the requested persistence mechanism.</comment>
<file context>
@@ -10,7 +10,8 @@ import {
import { Maximize2 } from 'lucide-react';
-import { useState } from 'react';
+import { useRef, useState } from 'react';
+import { loadEditorSize, saveEditorSize, type EditorSize } from './editor-size-storage';
interface EditableCellProps {
</file context>
The large multi-line cell editor could effectively only grow vertically (width was pinned by w-full inside a 760px dialog), and it always reopened at the default size — painful for long requirement text (e.g. NIST PL-2). - Textarea is now resizable in both directions (resize, min 320px wide), and the dialog grows to fit it up to 95vw. - The chosen size is remembered in localStorage and restored on reopen. Size persistence is a small tested helper (load/save with validation). Closes FRAME-3 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
a280ad2 to
9ef22dc
Compare
|
Rebased onto
17 tests pass (EditableCell incl. the merged FRAME-7 + FRAME-3 cases, plus the storage round-trip/validation tests); |
What
Makes the large multi-line cell editor (used for requirement/control descriptions) resizable in both directions and remembers the size between opens.
Why (FRAME-3)
w-fullinside a fixed 760px dialog, so horizontal dragging did nothing. Long requirement text (NIST SP800-53 PL-2 was called out as an extreme example) was cramped.Changes
resize,min-w-[320px],max-w-[92vw]). The dialog usesw-fit max-w-[95vw]so it grows to fit the textarea up to near full-viewport width.localStorageand restored on reopen. (The ticket said "cookie";localStorageis the idiomatic web-storage choice here — no server round-trip, per-browser — and behaves the same from the user's point of view. Happy to switch to a cookie if you specifically need it shared server-side.)editor-size-storage.ts): ignores malformed/zero/non-numeric values and storage errors.Testing
editor-size-storage.test.ts: 4 tests — round-trip, missing key, malformed JSON, invalid dimensions.EditableCell.test.tsx: added a test asserting the editor reopens at the persisted size. 11 tests pass.npx turbo run typecheck --filter=@trycompai/framework-editor: clean.Frontend-only; no API or DB changes. Worth a quick visual check on the preview (resize handle + reopen-at-size).
🤖 Generated with Claude Code
Summary by cubic
Makes the large description editor resizable in both directions and remembers its size between opens. Completes Linear FRAME-3 by adding horizontal resize and persisting dimensions via a cookie.
Written for commit 9ef22dc. Summary will update on new commits.