Skip to content

Commit 07864cd

Browse files
bmdavis419claude
andcommitted
fix: hide the scrollbar inside inline HTML pages
A page taller than its frame showed a scrollbar inside the reply. The injected base stylesheet now hides the page's scrollbar (it still scrolls), and the mobile feed's WebView hides its native scroll indicators. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 59071dc commit 07864cd

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎apps/mobile/src/features/threads/HtmlRenderWebView.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ export function HtmlRenderWebView(props: {
124124
allowsInlineMediaPlayback
125125
automaticallyAdjustContentInsets={!props.nested}
126126
bounces={!props.nested}
127+
showsVerticalScrollIndicator={!props.nested}
128+
showsHorizontalScrollIndicator={!props.nested}
127129
scrollEnabled={scrollable}
128130
nestedScrollEnabled={props.nested && overflows}
129131
overScrollMode={props.nested ? "never" : "always"}

‎packages/shared/src/htmlRender.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ export const HTML_RENDER_THEME_GUIDE = [
241241
"--destructive, --destructive-foreground, --destructive-surface, --warning, --warning-foreground, --warning-surface,",
242242
"--success, --success-foreground, --info, --info-foreground, --code-background, --code-foreground,",
243243
"--chart-1 … --chart-6 (categorical series for charts), --radius, --font-sans, --font-mono.",
244-
"The base stylesheet sets html background/color/font from these and body margin to 0; your own CSS overrides it.",
244+
"The base stylesheet sets html background/color/font from these, body margin to 0, and hides the page's scrollbar; your own CSS overrides it.",
245245
].join(" ");
246246

247247
/** Agent-facing layout rules for a page that sits inside a reply. */
@@ -265,9 +265,11 @@ export function htmlRenderThemeMessage(theme: HtmlRenderTheme) {
265265
return { type: HTML_RENDER_THEME_MESSAGE_TYPE, theme };
266266
}
267267

268+
// The frame scrolls a page taller than itself, but a scrollbar inside the
269+
// reply reads as a box within the thread, so it stays hidden.
268270
const BASE_CSS =
269-
"html{background:var(--background);color:var(--foreground);font-family:var(--font-sans);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%}" +
270-
"body{margin:0}code,kbd,pre,samp{font-family:var(--font-mono)}";
271+
"html{background:var(--background);color:var(--foreground);font-family:var(--font-sans);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;scrollbar-width:none}" +
272+
"html::-webkit-scrollbar{display:none}body{margin:0}code,kbd,pre,samp{font-family:var(--font-mono)}";
271273

272274
function rootRule(theme: HtmlRenderTheme): string {
273275
const declarations = Object.entries(theme.variables)

0 commit comments

Comments
 (0)