fix(ux): 10 UI/UX bugs from pre-release audit (toward no-bug launch gate)

Found via parallel screen audit; each confirmed in code:
- AuthGate: auto-prompt biometrics on lock (useEffect was imported but unused)
- CodeBlock: horizontal scroll for long code lines (were wrapped/mangled)
- DiffView: horizontal scroll instead of numberOfLines=1 truncation
- chat: biometric-cancel on send shows feedback instead of silently dropping msg
- chat: send failure restores input + attachments and alerts
- chat: removed dead /compact + /clear builtin commands (advertised, no-op)
- sessions: delete + rename failures alert instead of silent; rename guarded
  against double-submit
- sessions: onRefresh spinner no longer hangs forever if a refresh rejects
- add/edit connection: validate URL has http(s):// scheme before save/test

typecheck clean, 65/65 unit tests pass. Runtime UI behavior still needs on-device
verification per the pre-posting test gate (HANDOFF §0b).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
engineer
2026-06-08 05:34:12 -07:00
parent 609bd45889
commit 42fa36f3cd
7 changed files with 103 additions and 57 deletions

View File

@@ -61,14 +61,6 @@ const BUILTIN_COMMANDS: SlashCommand[] = [
icon: "person-outline",
type: "builtin",
},
{
trigger: "compact",
title: "Compact",
description: "Summarize conversation",
icon: "contract-outline",
type: "builtin",
},
{ trigger: "clear", title: "Clear", description: "Clear the session", icon: "trash-outline", type: "builtin" },
]
function getShortDir(dir?: string): string | null {
@@ -214,12 +206,6 @@ export default function SessionScreen() {
setInput("")
cycleAgent()
return
case "compact":
setInput("")
return
case "clear":
setInput("")
return
}
}
setInput(`/${cmd.trigger} `)
@@ -316,7 +302,10 @@ export default function SessionScreen() {
const handleSend = async () => {
if (!input.trim() && attachments.length === 0) return
const authenticated = await authenticateForMessage()
if (!authenticated) return
if (!authenticated) {
Alert.alert("Authentication required", "Biometric authentication is required to send. Please try again.")
return
}
const text = input.trim()
const files = [...attachments]
@@ -343,7 +332,15 @@ export default function SessionScreen() {
// Messages are queued server-side when the session is busy.
// No need to abort - just send and it will be processed after current response.
await sendMessage(text, model || undefined, agent || undefined, files)
try {
await sendMessage(text, model || undefined, agent || undefined, files)
} catch (err) {
console.error("Send failed:", err)
// Restore the user's text and attachments so their input isn't lost.
setInput((prev) => (prev ? prev : text))
setAttachments((prev) => (prev.length ? prev : files))
Alert.alert("Message not sent", "Could not send your message. Check your connection and try again.")
}
}
// In inverted mode, offset 0 = bottom. Show scroll button when scrolled away from bottom.