fix(webui): tighten mobile chat layout and soften transcript edges
This commit is contained in:
1 parent
ce885fa31e
commit
8af2d396ab
10 files changed
+183
-26
No files matched your search
@@ -59,11 +59,13 @@ export function ComposerUsagePopover({
|
||||
context,
|
||||
rounds,
|
||||
showLabel = false,
|
||||
compactLabel = false,
|
||||
bottomSheet = false,
|
||||
}: {
|
||||
context: ComposerContextUsage | null;
|
||||
rounds: readonly ComposerRoundUsage[];
|
||||
showLabel?: boolean;
|
||||
compactLabel?: boolean;
|
||||
bottomSheet?: boolean;
|
||||
}) {
|
||||
const { t, i18n } = useTranslation();
|
||||
@@ -123,6 +125,7 @@ export function ComposerUsagePopover({
|
||||
const RoundTrigger = bottomSheet ? PopoverTrigger : TooltipTrigger;
|
||||
const RoundContent = bottomSheet ? PopoverContent : TooltipContent;
|
||||
const RoundBar = bottomSheet ? "button" : "span";
|
||||
const showTextLabel = showLabel && (!compactLabel || contextPercentage !== null);
|
||||
const trigger = (
|
||||
<Trigger asChild>
|
||||
<button
|
||||
@@ -133,7 +136,7 @@ export function ComposerUsagePopover({
|
||||
"touch-target inline-flex size-5 shrink-0 items-center justify-center rounded-full",
|
||||
"text-muted-foreground transition-colors hover:text-foreground",
|
||||
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
||||
showLabel && "w-auto gap-1.5 px-2 text-xs",
|
||||
showTextLabel && "w-auto gap-1.5 px-2 text-xs",
|
||||
)}
|
||||
>
|
||||
{contextPercentage === null ? (
|
||||
@@ -179,7 +182,11 @@ export function ComposerUsagePopover({
|
||||
/>
|
||||
</svg>
|
||||
)}
|
||||
{showLabel ? <span aria-hidden>{contextDescription}</span> : null}
|
||||
{showTextLabel ? (
|
||||
<span aria-hidden className="whitespace-nowrap tabular-nums">
|
||||
{compactLabel && contextPercentage !== null ? `${contextPercentage}%` : contextDescription}
|
||||
</span>
|
||||
) : null}
|
||||
</button>
|
||||
</Trigger>
|
||||
);
|
||||
|
||||
@@ -2547,8 +2547,9 @@ export function ThreadComposer({
|
||||
onClick={modelNeedsSetup ? onModelBadgeClick : undefined}
|
||||
/>
|
||||
) : null;
|
||||
const usageInMeta = mobileWorkspaceControls || compactControls;
|
||||
const usageControl = !voiceRecorder.isRecording && (contextUsage || recentRoundUsage.length) ? (
|
||||
<ComposerUsagePopover context={contextUsage} rounds={recentRoundUsage} showLabel={compactControls} bottomSheet={compactControls} />
|
||||
<ComposerUsagePopover context={contextUsage} rounds={recentRoundUsage} showLabel={usageInMeta} compactLabel={mobileWorkspaceControls} bottomSheet={usageInMeta} />
|
||||
) : null;
|
||||
const inputTextClasses = cn(
|
||||
// Keep the overlay's CJK/Latin spacing aligned with the native textarea caret.
|
||||
@@ -2610,7 +2611,7 @@ export function ThreadComposer({
|
||||
"thread-composer-form relative w-full [--composer-action-margin:0px]",
|
||||
isHero
|
||||
? "px-0 [--composer-action-size:2rem] [--composer-footer-inset:0.75rem] sm:[--composer-footer-inset:1rem]"
|
||||
: "px-1 pb-1.5 pt-1 [--composer-action-size:2.25rem] [--composer-footer-inset:0.625rem] sm:px-0 sm:[--composer-footer-inset:0.75rem]",
|
||||
: "px-1 pb-0 pt-1 [--composer-action-size:2.25rem] [--composer-footer-inset:0.625rem] sm:px-0 sm:pb-1.5 sm:[--composer-footer-inset:0.75rem]",
|
||||
compactWhenIdle && "thread-composer-collapsible-layout",
|
||||
paletteBeside && "grid grid-cols-2 items-start gap-2 p-0",
|
||||
)}
|
||||
@@ -2838,7 +2839,7 @@ export function ThreadComposer({
|
||||
)}
|
||||
>
|
||||
{modelControl}
|
||||
{!compactControls ? usageControl : null}
|
||||
{!usageInMeta ? usageControl : null}
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
@@ -2899,18 +2900,22 @@ export function ThreadComposer({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{workspaceControl || mobileWorkspaceControls && accessControl || compactControls && usageControl ? (
|
||||
{workspaceControl || mobileWorkspaceControls && accessControl || usageInMeta && usageControl ? (
|
||||
<div className={cn(
|
||||
"thread-composer-meta mx-auto mt-1 flex w-full min-w-0 flex-wrap items-center gap-x-2 gap-y-1 pr-2 sm:pr-3",
|
||||
"thread-composer-meta mx-auto mt-1 flex w-full min-w-0 items-center gap-x-2 pr-2 sm:pr-3",
|
||||
mobileWorkspaceControls ? "flex-nowrap gap-x-1 pr-0" : "flex-wrap gap-y-1",
|
||||
isHero ? "max-w-[58rem]" : "max-w-[49.5rem]",
|
||||
paletteBeside && "col-start-1 row-start-2",
|
||||
)}>
|
||||
{mobileWorkspaceControls && compactControls && usageControl ? <div className="flex w-full justify-end">{usageControl}</div> : null}
|
||||
<div className={cn("thread-composer-workspace-group flex min-w-0 items-center gap-1", mobileWorkspaceControls ? "flex-1" : "flex-auto max-[359px]:flex-wrap")}>
|
||||
{workspaceControl}
|
||||
</div>
|
||||
{!mobileWorkspaceControls && compactControls && usageControl ? <div className="ml-auto shrink-0">{usageControl}</div> : null}
|
||||
{mobileWorkspaceControls && accessControl ? <div className="ml-auto min-w-0 max-w-[55%] shrink">{accessControl}</div> : null}
|
||||
{usageInMeta && usageControl || mobileWorkspaceControls && accessControl ? (
|
||||
<div className={cn("ml-auto flex shrink-0 items-center gap-1", mobileWorkspaceControls && "h-11 max-w-[calc(100%-3rem)]")}>
|
||||
{usageInMeta ? usageControl : null}
|
||||
{mobileWorkspaceControls ? accessControl : null}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
</form>
|
||||
|
||||
@@ -1213,7 +1213,7 @@ export const ThreadViewport = forwardRef<ThreadViewportHandle, ThreadViewportPro
|
||||
<div
|
||||
className={cn(
|
||||
hasThreadLayout
|
||||
? "px-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] sm:px-4"
|
||||
? "px-3 pb-[calc(0.5rem+env(safe-area-inset-bottom))] sm:px-4 sm:pb-[calc(0.75rem+env(safe-area-inset-bottom))]"
|
||||
: "",
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user