Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions apps/web/src/components/diffs/DiffCommentAnnotation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ describe("DiffCommentAnnotation", () => {
expect(markup).toContain("Add a comment…");
expect(markup).toContain(">Comment</button>");
expect(markup).toContain("autofocus");
const textareaControl = markup.match(/<span[^>]*data-slot="textarea-control"[^>]*>/)?.[0];
expect(textareaControl).toBeDefined();
expect(textareaControl).not.toContain("ring-ring");
expect(markup).toContain("cursor-text");
// The comment box is the standard small Textarea, not a bespoke surface.
expect(markup).toMatch(/<span[^>]*data-size="sm"[^>]*data-slot="textarea-control"/);
});

it("lets a pull-request diff configure actions without replacing the composer", () => {
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/components/diffs/DiffCommentAnnotation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ export function DiffCommentAnnotation({
<Textarea
ref={textareaRef}
autoFocus={focusOnMount}
unstyled
className="relative inline-flex w-full rounded-md border border-border/50 bg-background/20 font-sans text-foreground transition-colors focus-within:border-border/70 [&_[data-slot=textarea]]:min-h-12 [&_[data-slot=textarea]]:cursor-text [&_[data-slot=textarea]]:caret-foreground [&_[data-slot=textarea]]:px-2.5 [&_[data-slot=textarea]]:py-1.5 [&_[data-slot=textarea]]:font-sans [&_[data-slot=textarea]]:text-xs [&_[data-slot=textarea]]:leading-5 max-sm:[&_[data-slot=textarea]]:min-h-12"
size="sm"
value={displayedText}
placeholder={placeholder}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export function PullRequestCommentForm({
<div className="space-y-2">
<Textarea
ref={textareaRef}
className="[&_textarea]:max-h-64"
// Locked while posting: the body is cleared on success, which would otherwise throw
// away a new draft typed while the request was still in flight.
disabled={submitting !== null || actionPending}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ export function PullRequestReviewForm({
<Textarea
ref={textareaRef}
rows={3}
className="[&_textarea]:max-h-64"
value={body}
placeholder={
requestChangesSummaryRequired && verdicts.includes("request-changes")
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/components/ui/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ function Textarea({ className, size = "default", unstyled = false, ...props }: T
render={(defaultProps) => (
<textarea
className={cn(
"field-sizing-content min-h-17.5 w-full rounded-[inherit] px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)] outline-none max-sm:min-h-20.5",
// Auto-grows with content up to one cap, then scrolls.
"field-sizing-content min-h-17.5 max-h-64 w-full rounded-[inherit] px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)] outline-none max-sm:min-h-20.5",
size === "sm" &&
"min-h-16.5 px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)] max-sm:min-h-19.5",
size === "lg" && "min-h-18.5 py-[calc(--spacing(2)-1px)] max-sm:min-h-21.5",
Expand Down
2 changes: 1 addition & 1 deletion scripts/lint-restyle-ceiling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as NodeURL from "node:url";
// components/ui exports are migrated to variants (see vite.config.ts). This gate keeps the
// count from growing: CI fails when findings exceed the ceiling. Lower the ceiling when you
// migrate a file, and delete this script when the rule becomes an error.
export const RESTYLE_CEILING = 826;
export const RESTYLE_CEILING = 812;

const RULE = "shadcn(no-restyle)";

Expand Down
Loading