Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

fix(web): four surfaces stay inside the box they are given at phone width (#430)

Yaowei Zhengbf3e42a535bf
diff --git a/changelog/unreleased/2026-08-23-phone-width-overflow.md b/changelog/unreleased/2026-08-23-phone-width-overflow.md
new file mode 100644
index 00000000..e1ada354
--- /dev/null
+++ b/changelog/unreleased/2026-08-23-phone-width-overflow.md
@@ -0,0 +1,51 @@
+# Phone-width surfaces stay inside the box they are given
+
+- **Date:** 2026-08-23
+- **Type:** fix
+- **Scope:** `web`
+- **PR:** [#430](https://github.com/Prism-Shadow/penguin-harness/pull/430)
+
+[中文版](2026-08-23-phone-width-overflow.zh.md)
+
+Four surfaces in the Web App laid themselves out wider than the box they were given at phone width,
+and each one put something out of the reader's reach — off the screen, past a card's edge, or
+underneath the control next to it. All four now stay inside their box.
+
+## Skill library
+
+- A skill card's action buttons — quick invoke, manage installs, update installs — were carried
+ past the right edge of the screen and clipped away by the group section, leaving no way to tap
+ any of them. The card grid now declares its single-column track below the `sm` breakpoint rather
+ than leaving it implicit, so a card is no longer widened to fit the longest description it
+ carries untruncated.
+
+## Cost center
+
+- The recent-errors table squeezed its message column down to zero width and pushed the other
+ three columns past the right edge, taking the whole page into a sideways scroll. The table now
+ states the minimum width its four columns need and scrolls horizontally inside its own box,
+ leaving the page itself unscrolled.
+
+## Agent list
+
+- An Agent card's stats line — sessions, tools, skills, memories, vault keys, schedules, last
+ modified — ran past the card's padding at phone width and carried its last item onto the card's
+ edge. The line now wraps onto a second line instead. Where it already fits on one line, nothing
+ moves.
+
+## Agent memory settings
+
+- A memory group's header pushed its own title and item count out of the collapse button and
+ painted them on top of the export and import actions sitting beside it. The title now truncates
+ inside its button rather than escaping it, and on a row narrower than 28rem the three group
+ actions keep their icons and drop their text labels — the models page's group-header convention,
+ which this header already followed in every other respect. No action is hidden at any width;
+ each one carries its name in a tooltip and an accessible label.
+
+## The same pattern elsewhere
+
+- Two more grids declared responsive column counts with no base track: the Models page's model
+ cards and the Benchmark case browser's sidebar/detail split. Both now state the single-column
+ track below their breakpoint, so neither can be widened by a child's untruncatable content the
+ way the skill cards were. An audit of every `grid-cols-` site in the Web App found no others.
+
diff --git a/changelog/unreleased/2026-08-23-phone-width-overflow.zh.md b/changelog/unreleased/2026-08-23-phone-width-overflow.zh.md
new file mode 100644
index 00000000..cb35ee08
--- /dev/null
+++ b/changelog/unreleased/2026-08-23-phone-width-overflow.zh.md
@@ -0,0 +1,41 @@
+# 手机宽度下的界面不再越出自己的盒子
+
+- **Date:** 2026-08-23
+- **Type:** fix
+- **Scope:** `web`
+- **PR:** [#430](https://github.com/Prism-Shadow/penguin-harness/pull/430)
+
+[English](2026-08-23-phone-width-overflow.md)
+
+Web App 有四处在手机宽度下把自己排得比所在的盒子更宽,各自都让读者够不到本该看到的东西——被挤出屏幕、
+越过卡片边缘,或压在旁边的控件上。现在四处都留在各自的盒子之内。
+
+## 技能库
+
+- 技能卡片的操作按钮——快捷调用、管理安装、更新安装——被带到屏幕右缘之外,又被分组区块裁掉,因此
+ 一个都点不到。卡片网格现在在 `sm` 断点以下显式声明单列轨道,不再任其隐式生成,卡片也就不会再被
+ 撑到足以完整容纳其中最长的那条描述。
+
+## 成本中心
+
+- 最近异常表格把消息列压缩到零宽度,并把其余三列推出右缘,连带整个页面横向滚动。表格现在写明四列
+ 所需的最小宽度,并在自己的盒子内横向滚动,页面本身不再滚动。
+
+## Agent 列表
+
+- Agent 卡片的统计行——会话、工具、技能、记忆、保险柜密钥、定时任务、最近修改——在手机宽度下越过卡片
+ 内边距,把最后一项带到卡片边缘上。该行现在改为换到第二行;本来就排得下的宽度下位置不变。
+
+## Agent 记忆设置
+
+- 记忆分组的标题栏把自己的标题与条数挤出折叠按钮,压在旁边的导出、导入操作之上。标题现在在按钮内截断
+ 而不再逸出,且在宽度小于 28rem 的行上,三个分组操作保留图标、去掉文字标签——这正是该标题栏在其他方面
+ 一直沿用的模型页分组标题栏惯例。任何宽度下都不会隐藏操作本身,每个操作都以 tooltip 和无障碍名称说明
+ 自己是什么。
+
+## 同一形态的其他位置
+
+- 另有两处网格只声明了带断点的列数而没有基础轨道:模型页的模型卡片,以及 Benchmark 用例浏览器的
+ 侧栏/详情分栏。两者现在都在断点以下明确声明单列轨道,因此都不会再像技能卡片那样被子元素无法
+ 截断的内容撑开。对 Web App 中所有 `grid-cols-` 位置的排查未发现其他同类。
+
diff --git a/packages/web/src/features/agents/agents-page.tsx b/packages/web/src/features/agents/agents-page.tsx
index e0e1661e..b7afb5a8 100644
--- a/packages/web/src/features/agents/agents-page.tsx
+++ b/packages/web/src/features/agents/agents-page.tsx
@@ -280,8 +280,13 @@ export function AgentsPage() {
schedule counts are buttons deep-linking to the matching settings tab,
listed in the settings tabs' order (also for built-in Agents — their
Settings entry point has no gating either); session count and
- last-modified stay plain text */}
- <div className="mt-1.5 flex items-center gap-x-4 text-xs text-gray-500 dark:text-gray-400">
+ last-modified stay plain text.
+ flex-wrap is load-bearing: every item is shrink-0 (a count must not be
+ cut in half) and the row has no scroll box, so with nowrap the seven
+ items simply spill past the card's padding once the info column is
+ narrower than they are — a phone. Wrapping spends a second line instead,
+ and never triggers where the row already fits. */}
+ <div className="mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-gray-500 dark:text-gray-400">
<span
className="inline-flex shrink-0 items-center gap-1 tabular-nums"
title={S.agent.sessionCount(a.sessionCount)}
diff --git a/packages/web/src/features/agents/memory-tab.tsx b/packages/web/src/features/agents/memory-tab.tsx
index 82a909ec..a2ec7380 100644
--- a/packages/web/src/features/agents/memory-tab.tsx
+++ b/packages/web/src/features/agents/memory-tab.tsx
@@ -608,15 +608,25 @@ export function MemoryTab({
{/* Group header (the models page's group convention): the collapse button fills
the row, the group's own actions sit between it and the chevron — a real
<button> cannot nest another, so the actions are siblings, with the hover
- highlight on the whole header so it reads as a single unit. */}
- <div className="flex items-center gap-2 bg-gray-50 pr-2 transition-colors duration-150 hover:bg-gray-100 dark:bg-gray-900/60 dark:hover:bg-gray-800/60">
+ highlight on the whole header so it reads as a single unit.
+ The row is a size container, not a viewport breakpoint: the settings panel
+ narrows independently of the window. Below @md the three action labels drop
+ and only their icons remain — 28rem is where the English labels plus the count
+ stop fitting beside the title, and rem tracks the user's font tier
+ (state/theme.tsx), so the threshold scales with the labels it measures. No
+ action is hidden at any width; each keeps its icon, an aria-label and a
+ title. */}
+ <div className="@container flex items-center gap-2 bg-gray-50 pr-2 transition-colors duration-150 hover:bg-gray-100 dark:bg-gray-900/60 dark:hover:bg-gray-800/60">
<button
type="button"
aria-expanded={open}
onClick={() => toggleCollapsed(scope.scopeKey)}
className="flex min-w-0 flex-1 items-center gap-2.5 px-3.5 py-2.5 text-left"
>
- <span className="shrink-0 text-sm font-semibold text-gray-800 dark:text-gray-200">
+ {/* Scope title can truncate (min-w-0): the actions to its right must not
+ shrink, so a shrink-0 title is pushed out of the button box instead — and
+ a button does not clip, so it would paint on top of the first action. */}
+ <span className="min-w-0 truncate text-sm font-semibold text-gray-800 dark:text-gray-200">
{scopeTitle(scope)}
</span>
{scope.kind === "workspace" && scope.workspacePath !== undefined && (
@@ -625,13 +635,15 @@ export function MemoryTab({
</span>
)}
<span className="min-w-0 flex-1" />
- <span className="shrink-0 text-xs text-gray-400 dark:text-gray-500">
+ <span className="shrink-0 whitespace-nowrap text-xs text-gray-400 dark:text-gray-500">
{S.memory.itemCount(files.length)}
</span>
</button>
{/* Whole-group transfer, icon + label (the labels are what say which way a
- transfer goes): export for any member, import for the owner. The tooltip
- carries what the label cannot — that the whole group travels. */}
+ transfer goes, wherever the row is wide enough to keep them): export for any
+ member, import for the owner. The tooltip carries what the label cannot —
+ that the whole group travels — and on a narrow row, where the label is gone,
+ it carries the direction too, alongside the aria-label. */}
<span className="shrink-0">
<Button
size="sm"
@@ -641,7 +653,7 @@ export function MemoryTab({
onClick={() => void exportScope(scope)}
>
<DownloadIcon size={13} />
- {S.memory.exportScope}
+ <span className="hidden @md:inline">{S.memory.exportScope}</span>
</Button>
</span>
{isOwner && (
@@ -655,13 +667,19 @@ export function MemoryTab({
onChange={(e) => void pickImport(scope, e)}
/>
<UploadIcon size={13} />
- {S.memory.importScope}
+ <span className="hidden @md:inline">{S.memory.importScope}</span>
</label>
)}
<span className="shrink-0">
- <Button size="sm" variant="ghost" onClick={() => openAdd(scope)}>
+ <Button
+ size="sm"
+ variant="ghost"
+ title={S.memory.add}
+ aria-label={S.memory.addScopeLabel(scopeTitle(scope))}
+ onClick={() => openAdd(scope)}
+ >
<GlyphIcon d={PLUS_ICON} size={13} />
- {S.memory.add}
+ <span className="hidden @md:inline">{S.memory.add}</span>
</Button>
</span>
{/* Collapse arrow sits at the far right of the header (after the add entry); it too can be clicked to collapse. */}
diff --git a/packages/web/src/features/benchmark/benchmark-case-browser.tsx b/packages/web/src/features/benchmark/benchmark-case-browser.tsx
index 4518a546..0538f82a 100644
--- a/packages/web/src/features/benchmark/benchmark-case-browser.tsx
+++ b/packages/web/src/features/benchmark/benchmark-case-browser.tsx
@@ -387,7 +387,7 @@ export function BenchmarkCaseBrowser({ projectId, agentId, benchmarkId, caseSumm
};
return (
- <div className="grid min-h-[58vh] overflow-hidden rounded-md border border-gray-200 md:grid-cols-[240px_minmax(0,1fr)] dark:border-gray-800">
+ <div className="grid min-h-[58vh] grid-cols-1 overflow-hidden rounded-md border border-gray-200 md:grid-cols-[240px_minmax(0,1fr)] dark:border-gray-800">
<aside className="border-b border-gray-200 bg-gray-50/60 md:border-b-0 md:border-r dark:border-gray-800 dark:bg-gray-950/30">
<div className="max-h-44 overflow-y-auto md:max-h-[53vh]">
<MaterialGroup
diff --git a/packages/web/src/features/models/models-page.tsx b/packages/web/src/features/models/models-page.tsx
index 0a7126ff..d67a9850 100644
--- a/packages/web/src/features/models/models-page.tsx
+++ b/packages/web/src/features/models/models-page.tsx
@@ -918,7 +918,7 @@ export function ModelsPage() {
{/* inert while collapsed: a card with zero height shouldn't still be Tab-focusable or clickable. */}
<div className="overflow-hidden" inert={!open}>
<div
- className={`grid gap-2 border-t border-gray-200 p-2.5 transition-opacity duration-200 sm:grid-cols-2 lg:grid-cols-3 dark:border-gray-800 ${open ? "opacity-100" : "opacity-0"}`}
+ className={`grid grid-cols-1 gap-2 border-t border-gray-200 p-2.5 transition-opacity duration-200 sm:grid-cols-2 lg:grid-cols-3 dark:border-gray-800 ${open ? "opacity-100" : "opacity-0"}`}
>
{group.rows.length === 0 ? (
// An empty group only ever occurs for custom (always shown when there's no search query, to host the add entry point).
diff --git a/packages/web/src/features/skills/skills-page.tsx b/packages/web/src/features/skills/skills-page.tsx
index 2eed27f4..e397a234 100644
--- a/packages/web/src/features/skills/skills-page.tsx
+++ b/packages/web/src/features/skills/skills-page.tsx
@@ -271,7 +271,7 @@ export function SkillsPage() {
</Button>
</div>
) : groups === null ? (
- <div className="mt-6 grid gap-2.5 sm:grid-cols-2">
+ <div className="mt-6 grid grid-cols-1 gap-2.5 sm:grid-cols-2">
{Array.from({ length: 4 }, (_, i) => (
<SkeletonCard key={i} className="p-4">
<Skeleton className="h-4 w-32" />
@@ -324,9 +324,16 @@ export function SkillsPage() {
>
{/* inert while collapsed: cards at zero height shouldn't still be Tab-focusable or clickable. */}
<div className="overflow-hidden" inert={!open}>
- {/* Generously sized cards: 2 columns ≥sm, 1 column on narrow screens. */}
+ {/* Generously sized cards: 2 columns ≥sm, 1 column on narrow screens.
+ `grid-cols-1` is load-bearing, not redundant: with no declared track the
+ single implicit column is `auto`-sized, and an auto track never goes below
+ the widest card's min-content width — which `truncate` does not lower,
+ since `nowrap` leaves no wrap opportunity and `overflow: hidden` only
+ clips at paint time. A card then overflows the section's `overflow-hidden`
+ and its action buttons land off-viewport, unreachable. Tailwind's
+ `grid-cols-*` is `minmax(0, 1fr)`, which clamps that floor to 0. */}
<div
- className={`grid gap-2.5 p-2.5 transition-opacity duration-200 sm:grid-cols-2 ${open ? "opacity-100" : "opacity-0"}`}
+ className={`grid grid-cols-1 gap-2.5 p-2.5 transition-opacity duration-200 sm:grid-cols-2 ${open ? "opacity-100" : "opacity-0"}`}
>
{group.skills.map((skill) => (
<SkillCard
diff --git a/packages/web/src/features/usage/errors-panel.tsx b/packages/web/src/features/usage/errors-panel.tsx
index 69b9ec6b..8ba10454 100644
--- a/packages/web/src/features/usage/errors-panel.tsx
+++ b/packages/web/src/features/usage/errors-panel.tsx
@@ -81,7 +81,9 @@ function Th({ children, className = "" }: { children: React.ReactNode; className
* preserved — the upstream detail after the code, e.g. a provider's 402 body, is what matters),
* and clicking again collapses it. The full text is also in the hover title. Cells align to the
* top so an expanded multi-line message keeps the row tidy; height is bounded by the page size
- * alone — the table never scrolls (paging is the way past it).
+ * alone — the table never scrolls vertically (paging is the way past it). Its four columns need
+ * a floor to stay legible, so on a viewport narrower than that floor the table scrolls
+ * sideways inside its own box rather than dragging the page along with it.
*/
export function ErrorsPanel({
errors,
@@ -188,8 +190,14 @@ export function ErrorsPanel({
{items.length === 0 ? (
<Empty text={S.usage.errorsEmpty} />
) : (
- <div className="mt-2.5 border-t border-gray-200 dark:border-gray-800">
- <table className="w-full table-fixed text-xs">
+ <div className="mt-2.5 overflow-x-auto overflow-y-clip border-t border-gray-200 dark:border-gray-800">
+ {/* The three leading columns are fixed-width and the message column takes the rest, so
+ the table has a minimum below which `table-fixed` starves the message column down to
+ zero width and pushes the other three past the edge. `min-w` states that floor, and
+ this box scrolls it sideways when the viewport is narrower — the page itself must
+ never scroll sideways (styles.css). `overflow-y-clip` keeps browsers from reserving
+ a vertical scrollbar gutter beside the horizontal one. */}
+ <table className="w-full min-w-[720px] table-fixed text-xs">
<thead className="text-left text-gray-400 dark:text-gray-500">
<tr>
<Th className="w-32">{S.common.time}</Th>
diff --git a/packages/web/src/lib/strings-en.ts b/packages/web/src/lib/strings-en.ts
index 52c0e157..6a492a60 100644
--- a/packages/web/src/lib/strings-en.ts
+++ b/packages/web/src/lib/strings-en.ts
@@ -833,6 +833,7 @@ export const en: Strings = {
"No memories for this Workspace yet — the agent saves what is worth keeping as it works",
emptyUserScope: 'No user memories yet — say "remember …" in a chat and the agent will save it',
add: "Add",
+ addScopeLabel: (scope: string): string => `Add to ${scope}`,
addTitle: "Add memory",
addWhy:
"The agent organizes and saves memories in a chat: fill in the content, open a new conversation, and the agent does the rest.",
diff --git a/packages/web/src/lib/strings.ts b/packages/web/src/lib/strings.ts
index 661142f1..cc514e18 100644
--- a/packages/web/src/lib/strings.ts
+++ b/packages/web/src/lib/strings.ts
@@ -811,6 +811,8 @@ export const zh = {
emptyScope: "这个工作区还没有记忆——agent 会在会话中自行记下值得保留的信息",
emptyUserScope: "还没有用户记忆——在对话里说「记住……」即可让 agent 保存",
add: "添加",
+ /** Accessible name for the group header's add entry, which drops its visible label on a narrow row. */
+ addScopeLabel: (scope: string): string => `向${scope}添加`,
addTitle: "添加记忆",
addWhy: "记忆整理由 agent 在对话中完成:填写内容后打开新对话,由 agent 整理保存。",
addContentLabel: "要记住的内容或来源",