GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): notebook HTML outputs keep line-wrapped base64 images by only21mil · Pull Request #44260 · pingdotgg/t3code

Conversation

@only21mil

@only21mil only21mil commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Problem

When a notebook's text/html output embeds a line-wrapped base64 data URL (base64.encodebytes()), the preview drops the image or falls back to text/plain instead of rendering it. sanitizeDocumentHtml (DocumentPages.tsx) rejects payload whitespace and removes the <img>; htmlImagesFit (extendedDocumentPreview.ts) stops at the first newline, so base64ImageFits decodes only the first 76-char line (57 bytes) and rejects JPEGs with SOF past byte 57.

Change

sanitizeDocumentHtml accepts HTML ASCII whitespace ([\t\n\f\r ]) in the base64 payload and around ={0,2} padding, keeping the same data: scheme, four MIME types (png, jpeg, gif, webp), and base64 alphabet; non-ASCII whitespace and other schemes or MIME types are still removed. htmlImagesFit accepts that ASCII whitespace only inside a quoted src value and strips it before base64ImageFits, as the image/* path already strips whitespace.

Scope

Bug fix (image silently dropped from notebook previews). No issue: 3-line fix; browsers ignore ASCII whitespace in base64 data URLs, which the preview rejected.

Verification

  1. Open a project with a .ipynb notebook whose text/html output embeds base64.encodebytes() PNG and JPEG images.
  2. Open the .ipynb file in the Files panel and inspect those output cells.

Setup: Linux, Chromium in T3's Browser panel, light theme, 1100x1900 viewport, fresh isolated dev server per commit, synthetic notebook.
Steps: open project → open .ipynb in Files panel → inspect the single-line PNG, line-wrapped PNG and line-wrapped JPEG outputs.

5d94090ed031 fbb844f148ee
Before: chart B shows only its caption and chart C shows plain text
Before: chart B shows only its caption and chart C shows plain text
After: charts B and C render
After: charts B and C render

Tests in apps/web/src/components/files/AttachmentFilePreview.browser.test.tsx (both fail on 5d94090ed031, pass with this fix):

  • document output sanitization > preserves table content and raster data while removing scripts and network resources
  • bounds wrapped-jpeg-html image pixels before returning browser markup

The unquoted row also guards unquoted src, prose quotes and srcset descriptors that base already rendered.

vp run check:changed exits 0 (format, lint, knip, typecheck, all 95 browser tests, React Compiler).

Not shown:

  • Desktop (Electron): not run separately; shares the apps/web bundle.
  • Mobile (React Native): not run; apps/mobile does not use DocumentPages (git grep -n DocumentPages apps/mobile returns no matches).

Merged-tree check: fbb844f148ee merges cleanly into green main e3cd83a299d0; on that local merge all 95 tests in the file pass and vp run check:changed exits 0. Main commits since the base do not touch the notebook HTML path.

Focused browser test pass output, full file run, and check:changed summary
 ✓ |browser (chromium)| src/components/files/AttachmentFilePreview.browser.test.tsx (95 tests | 87 skipped) 1484ms

 Test Files  1 passed (1)
      Tests  8 passed | 87 skipped (95)
   Start at  14:15:48
   Duration  6.66s (tests 43%, import 37%, worker 19%, setup 1%)
 ✓ |browser (chromium)| src/components/files/AttachmentFilePreview.browser.test.tsx (95 tests) 18859ms

 Test Files  1 passed (1)
      Tests  95 passed (95)
   Start at  14:15:56
   Duration  24.13s (tests 89%, import 7%, worker 3%, setup 1%)
> vp react compiler (2 files)  pass  4.2s
 Test Files  1 passed (1)
      Tests  2 passed | 1522 skipped (1524)
   Duration  3.33s (transform 71%, setup 22%, import 4%, tests 3%)

check:changed summary
  pass  format  0.6s
  pass  lint  0.8s
  pass  knip 1/2  10.9s
  pass  knip 2/2  17.1s
  pass  typecheck (2 packages)  1.8s
  pass  test (1 files)  25.1s
  pass  react compiler (2 files)  4.2s
  CI also runs: full test suites, build
  unused patch check skipped: no dependency files changed

Generated with Gemini 4 Neon in T3 Code Nightly

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@only21mil
fix(web): notebook HTML outputs keep line-wrapped base64 images
fbb844f
Notebook text/html outputs that embed an image as a line-wrapped base64
data URL (Python base64.encodebytes) lost the image: the sanitizer's src
check rejected the newlines, and the notebook size check read only the
first line, which is too short to find a JPEG's dimensions.

Both checks now allow HTML ASCII whitespace in the payload, with the same
scheme, MIME types, alphabet and padding rule. The size check allows it
only inside a quoted src value, the one attribute the sanitizer keeps,
and strips it before reading the header.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 27, 2026
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Image data URL checks now accept whitespace in supported base64 payloads. Image-size detection recognizes data URLs in src attributes and standalone text. Browser tests cover wrapped payloads and additional HTML image forms.

Changes: Image data URL handling

Layer / File(s) Summary
Image matching and regression coverage
apps/web/src/components/files/DocumentPages.tsx, apps/web/src/components/files/extendedDocumentPreview.ts, apps/web/src/components/files/AttachmentFilePreview.browser.test.tsx
Document sanitization accepts whitespace in supported image payloads. Image-size detection recognizes data URLs in src attributes and standalone text, and removes payload whitespace before validation. Browser tests cover wrapped PNG and JPEG data, additional HTML image forms, and output classifications.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: saphid, yash-singh1

Merge Risk: Minimal · up to 84da2

This change lets notebook HTML outputs display images whose base64 data is wrapped across lines. The change is small and covered by tests, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the primary change: notebook HTML outputs with line-wrapped base64 images now render. It matches the objectives and the file summaries, which cover sanitizeDocumentHtml and htmlImagesF…
Description check Passed The description follows the template well. It has Problem, Change, Scope, and Verification sections. The Problem explains the bug and root cause. The Change explains the fix and its limits. Scope says…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the primary change: notebook HTML outputs with line-wrapped base64 images now render. It matches the objectives and the file summaries, which cover sanitizeDocumentHtml and htmlImagesFit changes for whitespace in base64 data URLs. It follows the conventional commit format and is specific.

Full details: Description check

Explanation

The description follows the template well. It has Problem, Change, Scope, and Verification sections. The Problem explains the bug and root cause. The Change explains the fix and its limits. Scope says this is a bug fix with no issue and gives a reason. Verification lists the reproduction steps, the failing and passing tests, the check command results, and the untested platforms. The description includes before/after screenshots for the UI change. Minor gaps: the Scope section gives a reason for no issue but does not link an issue, and the template asks for the model and harness, which the author gives (Gemini 4 Neon in T3 Code Nightly).

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: c103563
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0deba82d-d166-45af-a1fc-d81209852a19
Commits

Reviewing files that changed from the base of the PR and between fbb844f and 84da2c5.

Files selected for processing: 1

  • apps/web/src/components/files/AttachmentFilePreview.browser.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 27, 2026
@juliusmarminge @claude
Merge remote-tracking branch 'origin/main' into fix/web-document-page…
84da2c5
…s-base64-whitespace

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge
juliusmarminge force-pushed the fix/web-document-pages-base64-whitespace branch from 83dba7a to 84da2c5 Compare November 27, 2026 15:00
@juliusmarminge

juliusmarminge commented Nov 27, 2026

Copy link
Copy Markdown
Member

Evidence

Opened the same synthetic notebook in the real web client on both commits using scenarios:prove. Chromium on Linux, light theme, 1440×1080, fresh databases, Replay (dev). The notebook contains a single-line control PNG, a 76-column wrapped PNG, and a wrapped JPEG with its SOF0 marker at byte 158; both wrapped values end in a newline inside quoted src attributes.

Proven: base rendered only the control image; head rendered all three at 120×60. Final runner exit: 0.

Before After
Before: wrapped PNG missing and JPEG plain-text fallback After: all three images render
c103563d84 84da2c5e72

Self-contained scenario and notebook fixture · Before recording · After recording

Not shown:

  • Oversized-image rejection was not exercised; this visual proof covers the three reported valid-image cases.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the takeover:ready Takeover done; auto-lands when gates pass label Nov 27, 2026
@juliusmarminge
juliusmarminge merged commit 0a47638 into pingdotgg:main Nov 27, 2026
49 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge removed takeover:in-progress A takeover lead is working on this PR takeover:ready Takeover done; auto-lands when gates pass labels Nov 27, 2026
@github-actions github-actions Bot mentioned this pull request Nov 27, 2026
Upstream fixes (2026-11-27) Ryoku-dev/hyakki#13
Closed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 28, 2026
@github-actions
nightly: 0.1.14-nightly.20261127.5359
1d412ec
**v0.1.14-nightly.20261127.5359** · 83 changes from 16 contributors

- **Physical devices.** Use enrolled phones and tablets from Simlock pools in the Device panel.
- **Jira Service Management comments.** Choose whether a comment is an internal note or a customer-visible reply.
- **Sidebar thread lists.** Busy project folders show six threads at a time, with controls to show more or less.
- **Preview positions.** Code, log, table, and notebook previews remember your place when you switch files or threads.
- **Faster source control.** Git controls and the command palette open faster by checking source control services in parallel.
- **Linked folders.** Browse and open files in folders linked from outside your worktree.
- **Multi-repository pull requests.** The Pull requests page now lists pull requests from repositories in multi-repository projects.

### Plus 75 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(web): queued edits keep focus in the current thread by @StiensWout in pingdotgg/t3code#44237
* fix(client-runtime): work log previews scripts run with node -pe, python3 -uc or ruby -ne by @AymanKhan9 in pingdotgg/t3code#44252
* fix(server): selected commits show their subject when the message starts with blank lines by @only21mil in pingdotgg/t3code#44259
* fix(source-control): SCP-style remotes with @ or + in the username keep their host by @only21mil in pingdotgg/t3code#44256
* fix(server): preserve XLSX formulas with escaped blank caches by @jadelike-wine in pingdotgg/t3code#44261
* fix(cli): t3 theme set no longer ignores --id with a theme name by @iamshadmantaqi in pingdotgg/t3code#44268
* fix(server): preserve paragraphs in ODT text boxes by @jadelike-wine in pingdotgg/t3code#44265
* fix(web): notebook HTML outputs keep line-wrapped base64 images by @only21mil in pingdotgg/t3code#44260
* fix(server): t3_project_create from a title accepts a null default model by @only21mil in pingdotgg/t3code#44277
* fix(client-runtime): a renamed project keeps its name when another checkout joins its group by @smirea in pingdotgg/t3code#44281
* fix(web): the device panel opens in flat view by @maria-rcks in pingdotgg/t3code#43599
* feat(web): boring sidebar folders list six threads with Show more and Show less by @maria-rcks in pingdotgg/t3code#43598
* fix(web): shortcuts recorded on a Cyrillic or Greek layout keep working on a Latin one by @AymanKhan9 in pingdotgg/t3code#44275
* fix(server): omit hidden objects from PowerPoint attachment text by @jadelike-wine in pingdotgg/t3code#44287
* fix(server): keep saved names for imported Codex threads by @only21mil in pingdotgg/t3code#44284
* fix(server): keep EPUB table footers after body rows by @jadelike-wine in pingdotgg/t3code#44290
* fix(server): a provider handoff item no longer shows merge-back context by @only21mil in pingdotgg/t3code#44293
* fix(server): Antigravity turn with a finished reply completes when its prompt goes silent by @juliusmarminge in pingdotgg/t3code#44294
* fix(web): EPUB previews keep SVG drop-shadow filters by @only21mil in pingdotgg/t3code#44299
* fix(web): workflow run durations use the app language's units by @iamshadmantaqi in pingdotgg/t3code#44244
* fix(cli): resolve missing paths in linked worktrees by @jadelike-wine in pingdotgg/t3code#44305
* fix(web): GitHub sign-in code expiry follows the Time format setting by @AymanKhan9 in pingdotgg/t3code#44306
* fix(mobile): tapping an image in an html_render opens the image viewer by @juliusmarminge in pingdotgg/t3code#44315
* fix(server): keep Word phonetic guides after their words by @jadelike-wine in pingdotgg/t3code#44309
* fix(server): resolve favicon hrefs that use HTML references without a semicolon by @only21mil in pingdotgg/t3code#44314
* fix(server): /compact no longer runs on a session that lacks the thread's history by @juliusmarminge in pingdotgg/t3code#44295
* fix(client-runtime): work log labels unwrap $'...' and $"..." quoted shell scripts by @only21mil in pingdotgg/t3code#44322
* fix(web): ODT previews keep numbered lists by @only21mil in pingdotgg/t3code#44318
* fix(server): a resumed Claude session no longer counts its earlier turns again by @GLDRoger in pingdotgg/t3code#44311
* fix(server): separate nested cells in RTF attachment text by @jadelike-wine in pingdotgg/t3code#44327
* fix(web): collapsed reasoning rows no longer show footnote markup by @only21mil in pingdotgg/t3code#44337
* fix(web): EPUB previews keep tt and acronym tags by @only21mil in pingdotgg/t3code#44333
* fix(server): show the context handoff when an imported session's first send switches provider by @only21mil in pingdotgg/t3code#44332
* fix(server): skip EPUB passages hidden by important inline styles by @jadelike-wine in pingdotgg/t3code#44331
* fix(web): Enter sends dictation while focus is on the chat timeline by @BugByter123 in pingdotgg/t3code#44326
* fix(server): a successful settle script's terminal no longer stays open in the worktree by @smirea in pingdotgg/t3code#44351
* perf(server): pull request sweeps read threads through the shell index by @juliusmarminge in pingdotgg/t3code#44341
* perf(web): memoize model picker provider rows by @ndycode in pingdotgg/t3code#44338
* fix(forgejo): publishing a repository under your own name works in any letter case by @only21mil in pingdotgg/t3code#44348
* fix(client-runtime): work log labels unwrap timeout commands with options by @only21mil in pingdotgg/t3code#44357
* fix(azure-devops): partial clones scope az commands to their remote by @only21mil in pingdotgg/t3code#44346
* fix(mobile): ctrl then space sends NUL in the terminal by @iamshadmantaqi in pingdotgg/t3code#44359
* fix(web): closing a split pane in the right panel activates its neighbour by @iamshadmantaqi in pingdotgg/t3code#44358
* fix(issues): search Jira assignees past the loaded catalogue by @PixPMusic in pingdotgg/t3code#39944
* feat(issues): choose internal note or customer reply on Jira Service Management by @PixPMusic in pingdotgg/t3code#39942
* fix(server): separate footnotes from ODT attachment prose by @jadelike-wine in pingdotgg/t3code#44366
* fix(web): notebook previews use the kernel's language when language_info is missing by @only21mil in pingdotgg/t3code#44367
* fix(web): Markdown blocks keep the text direction their HTML sets by @only21mil in pingdotgg/t3code#44375
* fix(issues): a No project thread can read and write its linked Linear issues by @PixPMusic in pingdotgg/t3code#39938
* fix(client-runtime): NDJSON tool output keeps JSON highlighting by @only21mil in pingdotgg/t3code#44372
* fix(web): RTF previews keep nested table cells apart by @iamshadmantaqi in pingdotgg/t3code#44379
* refactor(server): launch commands through Effect 4.1.6's proxy process by @juliusmarminge in pingdotgg/t3code#44095
* fix(server): files in folders linked in from outside the worktree open in the files viewer by @juliusmarminge in pingdotgg/t3code#44381
* fix(web): the scheduled task menu translates Delete by @iamshadmantaqi in pingdotgg/t3code#44380
* feat(devices): Simlock pools offer enrolled phones and tablets by @bheemreddy-samsara in pingdotgg/t3code#37363
* fix(mobile): Changed files rows say 1 addition and 1 deletion by @iamshadmantaqi in pingdotgg/t3code#44376
* fix(web): code, log, CSV and notebook previews keep their place across files and threads by @Wraient in pingdotgg/t3code#44374
* fix(server): omit hidden sections from ODT attachment text by @Lucenx9 in pingdotgg/t3code#44384
* fix(server): settle scripts run one at a time by @smirea in pingdotgg/t3code#44363
* fix(client-runtime): work log previews node -e scripts after --input-type or --env-file by @only21mil in pingdotgg/t3code#44388
* fix(client-runtime): keep retrying direct routes when T3 Connect is off by @jadelike-wine in pingdotgg/t3code#44365
* fix(server): a link card stops reading as Awaiting Input once a later run completes by @juliusmarminge in pingdotgg/t3code#44397
* fix(web): RTF previews no longer drop double, dotted and other underlines by @only21mil in pingdotgg/t3code#44404
* fix(gitlab): issue renames show in Activity with the full new title by @only21mil in pingdotgg/t3code#44390
* fix(web): a link pasted into inline code stays plain text by @iamshadmantaqi in pingdotgg/t3code#44409
* fix(web): hide the extra TAR root folder by @StiensWout in pingdotgg/t3code#44411
* fix(server): a loaded Codex chat keeps working after a stdio MCP server is removed by @juliusmarminge in pingdotgg/t3code#44418
* fix(server): ODT attachments keep ruby readings in brackets by @iamshadmantaqi in pingdotgg/t3code#44412
* fix(diagnostics): count OTLP errors named Interrupted only as failures by @jadelike-wine in pingdotgg/t3code#44415
* fix(server): omit hidden paragraphs from ODT attachment text by @jadelike-wine in pingdotgg/t3code#44413
* fix(opencode): Go usage shows once across environments sharing a Console workspace by @juliusmarminge in pingdotgg/t3code#44425
* fix(server): a worktree delete that stops partway leaves a worktree Git can remove again by @smirea in pingdotgg/t3code#44406
* perf(server): source control discovery runs its probes in parallel by @juliusmarminge in pingdotgg/t3code#43651
* fix(desktop): a stop signal right after the AppImage t3 CLI starts no longer unmounts it by @juliusmarminge in pingdotgg/t3code#44445
* fix(web): settings search finds the worktree cleanup row by its title by @iamshadmantaqi in pingdotgg/t3code#44432
* fix(web,marketing): describe product usage data as pseudonymous, not anonymous by @nabertronic in pingdotgg/t3code#44428
* fix(web): EPUB captions honor frame offsets by @StiensWout in pingdotgg/t3code#44429
* fix(web): EPUB previews preserve SVG color adjustments by @StiensWout in pingdotgg/t3code#44419
* fix(server): adopt worktrees with Unicode line separators in their paths by @Lucenx9 in pingdotgg/t3code#44422
* fix(client-runtime): work log commands split with a trailing backslash show their script by @only21mil in pingdotgg/t3code#44427
* fix(server): imported transcripts keep the indentation of their first line by @only21mil in pingdotgg/t3code#44426
* fix(web): Usage access errors follow the app language by @iamshadmantaqi in pingdotgg/t3code#44431
* fix(server): multi-repository projects list their pull requests by @juliusmarminge in pingdotgg/t3code#44399

## New Contributors
* @BugByter123 made their first contribution in pingdotgg/t3code#44326
* @bheemreddy-samsara made their first contribution in pingdotgg/t3code#37363
* @nabertronic made their first contribution in pingdotgg/t3code#44428

**Full Changelog**: pingdotgg/t3code@v0.1.14-nightly.20261127.5345...v0.1.14-nightly.20261127.5359

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.14-nightly.20261127.5359
@omegent-app omegent-app Bot mentioned this pull request Nov 28, 2026
Merge upstream main through 0f78747290a1 patroza/t3code#688
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@only21mil @juliusmarminge
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.