Skip to content

Optimize the views for phones - #116

Merged
codeling merged 4 commits into
mainfrom
claude/optimize-mobile-views
Nov 20, 2026
Merged

codeling merged 4 commits into
mainfrom
claude/optimize-mobile-views

Conversation

@codeling

@codeling codeling commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

What changes on phones

Narrow screens (≤ 600px)

  • History of a page: the Author and Version columns are hidden (class wideonly). The page of a version still shows both, in its banner.
  • List of all pages: the Size column is hidden. Each page takes two lines: the name, then the date on the left and the five icons on the right. As a table, the icons squeezed names down to a few letters per line, even at 390px.
  • Uploads: the Usage (Markdown snippet) and Size columns are hidden.
  • Title bar: a single line. The title sits above the date (in small text) and the page's icons are next to them. A title that is too long is cut off with "…". Both bars together are 75px high: 113px with the first version of this PR, 64–83px on main.
  • Toolbar: it is a flex row, and the search box takes the space the icons leave (it used to be 5em).
  • Other: images can use the full width, the rename field fits the screen, and the login page gets a margin.

Touch screens (pointer: coarse)

  • Icons in the title bar, toolbar, lists and the theme button are 1.5rem with 6px padding, so each tap target is about 35px (they were about 19px).
  • Text fields and the editor's text use at least 16px text, so iOS no longer zooms in when a field gets the focus.
  • Buttons are a bit taller, and the sidebar and "What links here" lists have more line spacing.
  • While typing in the editor: the title bar and toolbar are hidden while the editor's text has the focus, on a touch screen up to 600px wide or under 500px high. With the keyboard open (a 390×420 viewport), the text area grows from 110px to 202px.
    • The formatting buttons keep the focus in the text, so the bars stay hidden while you use them.
    • Save stays where it is when the bars come back.

Editor, all screens

  • Import button: the wide "Insert text from file…" button below the text is now an icon in the formatting toolbar, after the upload icon, like the other ways to insert something. The hidden file field moved with it.
    • On phones, Save, Cancel and Preview now fit on one row.
    • The icon is new in webicons/: insert-file, a page with an arrow pointing into it, drawn like new.svg. It is also proposed upstream in Add the insert-file icon webicons#4.
    • The old button's text is no longer used, so it is removed from de.php.
  • Link buttons: both are icons now.
    • The button for a link to a wiki page showed "[[ ]]" in bold Courier, wider than the others. It now has the chain (link.svg).
    • The Ctrl+K button, which links to an address ([text](url)), had the chain before. It now has the globe (internet.svg), the mark that pages already show after links to addresses, so the two buttons side by side look different.
    • The style for text labels in the toolbar is removed, since nothing uses it any more.

Everywhere: table cells use overflow-wrap: anywhere instead of word-break: break-all. Words now break only where they don't fit, so a name like "Meeting Notes 2026-11-17" no longer splits into "202 / 6-11-17".

Apart from the editor's buttons, wide screens look the same as before. I compared screenshots of every view at 1280px; the only differences were timestamps.

Code

  • sortableHeadings() and table-head.php take an optional class for each column.
  • Templates: all-pages.php (pagelist, pagename and modified classes), upload-list.php, history.php, page.php (pageactions and searchform classes), format-bar.php and editor.php (the import and link buttons).
  • index.css: a new section "Small screens and touch screens" at the end.

Tests

  • New tests/Browser/mobile.spec.js checks:
    • no view is wider than the screen at 320 and 390px;
    • the hidden columns are hidden;
    • the page list has its two-line layout;
    • the title bar is one line at 320 and 390px, long titles are cut off, and both bars end by 80px;
    • the bars hide while you type in the editor, the formatting buttons leave them hidden, Save doesn't move, and saving works;
    • tap targets are at least 34px and text fields use at least 16px text;
    • wide screens keep all columns, the small icons, and the bars while typing.
      Except for the no-overflow checks, these tests fail without the CSS.
  • editor-import.spec.js:
    • the icon comes after the upload icon, and the buttons below the text are only Save, Cancel and Preview;
    • a new test checks that the icon inserts the file at the cursor and leaves the focus in the text.
  • FormatBarTest checks the icons of both link buttons and counts 18 buttons. toolbar.spec.js checks the contrast of both link icons in the dark scheme.
  • FormsTest checks where the import button is and that the old text button is gone.
  • ListViewsTest checks the column classes, and PageFrameTest checks the icon group in the title bar. GitHistoryTest's pattern for the history rows now allows the new cell classes.
  • Locally, vendor/bin/phpunit: 2277 tests pass (143 skipped: the server/container tests). Playwright: 274 passed, 9 skipped.
  • Unrelated to this PR: one local run failed once in the dark-scheme check of history.spec.js, and the next full run passed. That test reads the next page right after clicking a link, without waiting for it to load. Separately, on main, a new page whose text equals another page's shows its creation as "not changed (renamed)", because git log --follow pairs the identical files.

Generated by Claude Code

On narrow screens (up to 600px), the lists leave out the columns which say
little there (class "wideonly"): the author and version in the history of a
page (the page of a version has them), the size of pages and files, and how
to refer to an uploaded file. The list of all pages shows each page in two
lines: the name, then the date and the icons, which don't fit next to it.
The title bar and the toolbar wrap as a whole: the icons of a page stay
together, and the search box takes the space which the icons leave.

On touch screens, the icons of the bars and the lists are larger and have
room around them to tap them (about 35px), and form fields have text of at
least 16px, as iOS zooms into smaller text when a field gets the focus.

Table cells break long words only where they don't fit (overflow-wrap:
anywhere instead of word-break: break-all), so page names are no longer
broken in the middle of words. Wide screens look as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFJFMPuuJS5KWXNTediQpN
The title bar of phones was two lines (title and date, then the icons of
the page) above the toolbar: 113px of the screen. It is one line now, the
title (cut off with "…" if it is too long) above the date in small text,
and the icons next to them; the bars have less padding. Both bars take
75px.

While the text of the editor has the focus on a phone (touch screen up to
600px wide, or less than 500px high, as with the on-screen keyboard), the
title bar and the toolbar are hidden, which almost doubles the height of
the text with the keyboard open (202px instead of 110px of 420px). The
buttons of the formatting toolbar keep the focus in the text, and Save
stays where it is when the bars come back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFJFMPuuJS5KWXNTediQpN
…lbar

"Insert text from file…" was a wide text button below the text, which made
the row of buttons wrap on phones (Preview on a second line). It is now an
icon of the formatting toolbar, after the one to upload a file, like the
other ways to insert something; the file field goes with it. The icon is
new in webicons/ (insert-file: a page with an arrow into it, drawn like
new.svg; check.js and preview.html updated). The text of the old button is
no longer used (removed from de.php).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFJFMPuuJS5KWXNTediQpN
The button which links to a page of the wiki showed "[[ ]]" in bold
Courier, wider than the other buttons. It now has the chain (link.svg),
the usual icon for links. The button of Ctrl+K, which links to an address
([text](url)), had the chain before; it gets the globe (internet.svg)
instead, which marks links to addresses in the pages, so that the two
buttons side by side can be told apart. The style of text labels in the
toolbar is no longer used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFJFMPuuJS5KWXNTediQpN
@codeling
codeling merged commit 217714e into main Nov 20, 2026
21 checks passed
@codeling
codeling deleted the claude/optimize-mobile-views branch November 20, 2026 22:26
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