Skip to content

Phones get the phone layout, and a much denser KERNEL·M - #7

Merged
dogum merged 2 commits into
mainfrom
claude/python-notebook-project-review-ppwmbf
Sep 29, 2026
Merged

dogum merged 2 commits into
mainfrom
claude/python-notebook-project-review-ppwmbf

Conversation

@dogum

@dogum dogum commented Sep 29, 2026

Copy link
Copy Markdown
Owner

On an iPhone, KERNEL·A (kernel-agent.html) had no phone layout:

  • the header stacked the toolbar into a column;
  • the page laid out 534px wide;
  • the footer wrapped into a tall block;
  • COPY/CSV covered table headers.

The phone build, KERNEL·M, fit the screen but was loose: 16px code, a toolbar clipped off the right edge, and RUN ALL stuck highlighted after one tap. This PR sends phones to the phone layout and makes that layout much denser.

Phones get the phone layout

  • kernel-agent.html sends touch devices with a phone-sized screen to kernel-agent-mobile.html. The query and hash are kept, so example links still work, and both pages share the same notebooks.
  • ?layout=desktop keeps the desktop layout for the rest of the tab's session and is removed from the URL. The KERNEL·A entry in the app menu uses it, including the copy of the menu in kernel.html.
  • In narrow windows the desktop layout holds together: the header takes two rows with a toolbar that scrolls sideways, and the footer wraps.

A denser KERNEL·M

  • Header. One 32px row (it was 251px on the desktop page): brand without the version, notebook, status dot, Interrupt while a cell runs, and ⋯. The dot shows words only while booting, busy or failed. ⋯ now holds New, Open, Save .ipynb, Save ZIP and Restart Python.
  • Notebook.
    • Code is 12px in a 32px gutter; markdown drops its gutter so prose uses the full width, at 13.5px.
    • Tables are 10.5px with 2px cell padding.
    • Outputs, cell tools, the add row and the first-run card are all tighter. The card hides its keyboard tips.
  • Agent sheet. The header, thread and run bars each take one line. The transcript runs edge to edge without its inset box, with smaller chips and a shorter composer. The ⌘J hint is dropped on phones.
  • Files and Variables. The sheets fit their contents instead of always taking 86% of the screen, with tighter rows.
  • Tab bar. 46px instead of 56px.
  • iOS focus zoom. iOS zooms into any focused field under 16px. On iOS the viewport tag now adds maximum-scale=1, which stops that zoom but still allows pinch zoom. Fields can use compact type, and the code editor's font now matches its highlighting overlay.

Fixes

  • On touch screens, COPY, CSV and PNG sit in a row under the output instead of covering it.
  • RUN ALL in the tab bar stayed highlighted forever because the bar never cleared it. It is now lit while runAll() runs.
  • A long run time like "12.43 s" borrows the code's left padding instead of spilling out of the cell.
  • The iOS "Add to Home Screen" hint hides itself after nine seconds, and toasts stay above it.

Tests

  • New tests/e2e/phone.mjs runs at iPhone size (390×844, touch, mobile Safari user agent) and checks:

    • the redirect, with ?example intact, and the ?layout=desktop opt-out lasting for the tab;
    • no sideways scroll and a header of 52px or less;
    • the ⋯ items and what they run;
    • code at 12px lined up with its highlighting;
    • COPY/CSV below the table and long run times inside the cell;
    • a short Files sheet;
    • RUN ALL clearing after the run.

    It fails on main at the first check.

  • harness.mjs gains a PHONE context, and run.mjs runs the phone suite.

  • ui.mjs accepts app-menu links that carry a query string.

  • npm run check, npm test and the full browser suite (desktop, mobile and phone) pass.

Tested with Chrome's phone emulation, not on a real iPhone.

🤖 Generated with Claude Code

https://claude.ai/code/session_01S9PfSmbaV1CY9ZawtfbiEm


Generated by Claude Code

KERNEL·A has no phone CSS: on an iPhone its header stacked the toolbar
into a column, the page laid out 534px wide, the footer wrapped into a
tall block, and COPY/CSV covered table headers.

- kernel-agent.html sends touch devices with a phone-sized screen to
  kernel-agent-mobile.html, keeping the query and hash, so example links
  work. ?layout=desktop keeps the desktop layout for the tab, and the app
  menu's KERNEL·A entry uses it. In narrow windows the desktop header
  takes two rows with a sideways-scrolling toolbar, and the footer wraps.
- KERNEL·M's header is one row: brand without the version, notebook,
  status dot (words only while booting, busy or failed), Interrupt while
  busy, and ⋯, which now holds New, Open, Save .ipynb, Save ZIP and
  Restart Python.
- Density: 12.5px code in a 34px gutter, 14px prose, and tighter cells,
  outputs, tables, cell tools, first-run card (keyboard tips hidden),
  toasts, tab bar, sheets and modals. Files and Variables sheets fit
  their contents. On iOS the viewport tag stops focus zoom, so fields
  no longer need 16px type and the code editor matches its overlay.
- On touch screens, output buttons sit in a row under the output. The
  iOS install hint hides itself after nine seconds, and toasts stay
  above it.

tests/e2e/phone.mjs checks all of this at iPhone size: the redirect and
its opt-out, no sideways scroll, a compact header, the ⋯ actions, code
aligned with its highlighting, buttons below tables, and a Files sheet
shorter than the screen. It fails on the previous build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S9PfSmbaV1CY9ZawtfbiEm
A second pass after testing on an iPhone:

- Header 39px to 32px, tab bar 52px to 46px, smaller brand and pills.
- Code 12px in a 32px gutter with tighter padding; markdown cells drop
  their gutter so prose takes the width; 13.5px prose, 10.5px tables
  with 2px cell padding, smaller output buttons, shorter cell tools.
- Agent sheet: one-line header, thread and run bars; the transcript runs
  edge to edge without its inset box; smaller chips, composer and row.
- Files and Variables: tighter rows, smaller names and actions.
- A long run time ("12.43 s") borrows the code's left padding instead of
  spilling out of the cell.
- RUN ALL in the tab bar stayed highlighted after one tap, because the
  bar never cleared it. It now lights up while runAll() runs and clears
  when it finishes.

phone.mjs checks the new code size, that run times stay inside their
cells, and that RUN ALL clears after the run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S9PfSmbaV1CY9ZawtfbiEm
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T00:25:37.223917Z 0e11789 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dogum
dogum merged commit fecaa6f into main Sep 29, 2026
4 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e11789edf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agent/desktop.html
Comment on lines +19 to +20
if (matchMedia("(pointer:coarse)").matches && Math.min(screen.width, screen.height) <= 600)
location.replace("kernel-agent-mobile.html" + location.search + location.hash);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve standalone desktop downloads on phones

When kernel-agent.html is downloaded and opened by itself on a phone—the README's documented single-file workflow—this navigation requests a separate kernel-agent-mobile.html sibling that the user did not download, leaving the app unusable. Restrict the redirect to hosted deployments where the mobile artifact is available, or retain a usable in-file phone layout.

Useful? React with 👍 / 👎.

Comment on lines +212 to +213
Promise.resolve(runAll()).finally(function () {
b.classList.remove("active");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the run indicator active across repeated taps

If the user taps Run All again while the first run is still executing, the second runAll() returns immediately because busy is true, and its finally removes active even though the original run continues. Ignore taps while this button is active or derive the indicator from the outstanding run so one invocation cannot clear another invocation's state.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants