📱 prevent mobile compose header overflow
Browse files at this commitccf832bb5fbc4e6d89ac214c47ab629fd5a40da8Parent: 0069847- fix
- 📱 prevent mobile compose header overflow
2 changed files +19 -2
- src/components/exams/bank-question-picker.test.tsx +17 -0
- src/components/messages/gmail-compose-box.tsx +2 -2
src/components/exams/bank-question-picker.test.tsxmodified+17 -0
| @@ -38,3 +38,20 @@ test("insert stays disabled until a target subject is explicitly picked", async | |||
| 38 | await Promise.resolve(); | 38 | await Promise.resolve(); |
| 39 | expect(onInsert).toHaveBeenCalledWith("bq-1", "s-1"); | 39 | expect(onInsert).toHaveBeenCalledWith("bq-1", "s-1"); |
| 40 | }); | 40 | }); |
| 41 | + | ||
| 42 | +test("cancel delegates to the owning panel", () => { | ||
| 43 | + const onCancel = vi.fn(); | ||
| 44 | + render(() => ( | ||
| 45 | + <PreferencesProvider> | ||
| 46 | + <BankQuestionPicker | ||
| 47 | + subjects={[]} | ||
| 48 | + onInsert={async () => {}} | ||
| 49 | + onCancel={onCancel} | ||
| 50 | + /> | ||
| 51 | + </PreferencesProvider> | ||
| 52 | + )); | ||
| 53 | + | ||
| 54 | + fireEvent.click(screen.getByRole("button", { name: "Cancel" })); | ||
| 55 | + | ||
| 56 | + expect(onCancel).toHaveBeenCalledOnce(); | ||
| 57 | +}); | ||
src/components/messages/gmail-compose-box.tsxmodified+2 -2
| @@ -86,9 +86,9 @@ export function GmailComposeBox(props: GmailComposeBoxProps) { | |||
| 86 | > | 86 | > |
| 87 | {/* Gmail Header */} | 87 | {/* Gmail Header */} |
| 88 | <div class="flex h-9 items-center justify-between rounded-t-xl border-b border-border-hairline bg-surface-overlay px-4"> | 88 | <div class="flex h-9 items-center justify-between rounded-t-xl border-b border-border-hairline bg-surface-overlay px-4"> |
| 89 | - <div class="flex items-center gap-2"> | 89 | + <div class="flex min-w-0 flex-1 items-center gap-2"> |
| 90 | <span class="h-2.5 w-2.5 rounded-full bg-primary" /> | 90 | <span class="h-2.5 w-2.5 rounded-full bg-primary" /> |
| 91 | - <h3 class="text-xs font-bold text-foreground truncate max-w-[340px]"> | 91 | + <h3 class="min-w-0 truncate text-xs font-bold text-foreground"> |
| 92 | {subject() ? subject() : t("messages.newMessage")} | 92 | {subject() ? subject() : t("messages.newMessage")} |
| 93 | </h3> | 93 | </h3> |
| 94 | </div> | 94 | </div> |