Repository navigation
Move the run buttons into the tab bar, add a host tab and compact the input - #1194
Merged
Merged
Conversation
Run, Debug and Stop now sit in the row of the file tabs as 32px buttons, and the buttons slot follows them after a divider. While debugging the row holds only Stop debugging. The demo app moves its example picker to the header, since a select does not fit in a 44px toolbar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
p-code-runner takes a host-tab slot for the label of a tab that is not a file and a host-tab-panel slot for its content. The tab follows a divider after the add-file button and uses the same roving tabindex and arrow keys as the file tabs. HOST_TAB and CODE_TAB are exported so the host can select a tab from code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The outlined text field was 56px and the Enter button stretched along with it. Both are 40px now, with less padding around them, and the button gets a return-key icon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bmesuere
commented
Oct 11, 2026
bmesuere
left a comment
Member
Author
There was a problem hiding this comment.
Found three reproducible issues: a filename collision, a stale accessible panel name, and header overflow. Details are attached inline. The existing targeted component and debugger state tests pass (19 tests). TypeScript and lint checks on the changed source files pass. Separate reproduction tests fail for each finding; the filename and header checks pass on the base commit.
CODE_TAB and HOST_TAB were the strings "code" and "host-tab", so a file with one of those names opened the code editor or the host panel instead of the file viewer. They are symbols now, and every string in activeEditorTab is a file name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The panel name was read only when the host tab appeared, so replacing the label element or changing its text left the old name on the open panel. The label is now read on every slotchange and whenever the label's text changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the example picker in the header, the pickers needed 859px and the header overflowed narrower windows. The header and its picker groups now wrap onto more rows instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
p-code-runner is now a size container named papyros-code-runner. Below 30rem the run buttons become 32px icon buttons with an aria-label and a tooltip, and the button row no longer wraps, so the bar takes at most two rows and the divider never ends one. Hosts can query the same container to compact their slotted buttons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At 358px the placeholder of One at a time was cut off. The text is shorter
now ("Type input and press Enter", "Typ invoer en druk op Enter"), and
below 25rem p-input shows the Enter button as an icon button with an
aria-label and a tooltip, so the field gets the room of the label.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A slotted button taller than 32px made the button row taller than the 44px tab bar, so the two hairlines no longer met. The tab bar now grows with the row. The README says slotted buttons should be 32px high. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Runner.start selects the code tab before its first await and only settles
when the run ends, so a host could not open its tab for the run in a
reliable way. start(mode, { editorTab }) now selects the given tab
instead; without the option it still selects the code. RunOptions is
exported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TomNaessens
reviewed
Oct 12, 2026
TomNaessens
left a comment
Contributor
There was a problem hiding this comment.
🤖 Three notes from a review requested by Tom; none of them blocks this PR.
This was referenced Oct 12, 2026
TomNaessens
approved these changes
Oct 12, 2026
Selecting HOST_TAB before the host fills the host-tab slot rendered an empty panel with no selected tab, and no slotchange came to fall back. The code runner and the tab bar now show the code tab in that case without changing activeEditorTab, so the host tab opens once its label arrives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The min-height that keeps the tab bar level with the run buttons applied to every p-editor-tabs. p-editor-tabs is 36px again by default, and p-code-runner gives its own tab bar the 44px minimum height. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run doctests used the play icon of Run, so the two compact buttons in a narrow code runner looked the same. It now uses mdi-playlist-check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It pairs with bug-play of Debug: a glyph for what runs, with a small play triangle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The buttons after the first got ref(undefined). lit-html 3.3.2 throws on that when the button is removed (Cannot set properties of undefined), which happened on every Run in Dodona, whose lockfile has 3.3.2. 3.3.3 ignores an undefined ref, so the tests here did not see it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The run buttons became icon buttons at a fixed 30rem. A host whose slotted button is wide (Dodona's Finalize and submit) then got a bar of two rows between 30rem and the width everything needs, or had to compact its own button first. p-code-runner now measures the tabs and both forms of the buttons and shows icon buttons whenever that keeps the bar on one row. Below 30rem they stay icons, and when even the icons do not fit, the labelled buttons wrap to their own row as before. The form that is not shown is laid out invisibly instead of with display: none, so both can be measured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A host that compacted its slotted buttons with a container query did so at a fixed width, often while there was still room for their labels. p-code-runner now compacts the run buttons first and, when the row still does not fit, sets a compact-slotted attribute on itself for the host to compact its own buttons. It keeps the width of the slotted buttons with and without the attribute, so it does not flip back and forth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #1193: items 1, 2 and 4 (Run and Debug in the tab bar, a tab supplied by the host, a compact
p-input), plus the narrow-width behaviour of these elements. The output panel, the debugger header and the container queries of the other panels (items 3, 5 and 6) are done in another branch.What changed
Run and Debug in the tab bar (
p-code-runner,p-button-lint).p-button-lintmoved from below the editor pane into the row ofp-editor-tabs. The row is 44px high and the buttons are 32px (--md-*-button-container-height). The 44px minimum is set byp-code-runneron its own tab bar; ap-editor-tabselsewhere stays 36px. Thebuttonsslot follows after a 1px divider, which only shows when the slot has content. Slotted buttons should be 32px high too; a taller one makes the whole row taller, and the tab bar grows with it so the two hairlines stay level. While debugging the row shows only Stop debugging: the slot and its divider are hidden. The add-file button also stays hidden while debugging, as before: adding files to a trace makes no sense, and the "+" in the render was a mockup inaccuracy. The demo app's example picker moved to the header, since an outlined select does not fit in a 44px toolbar. The header and its picker groups now wrap, so the header fits at 800px and at phone widths.Narrow columns. The bar stays on one row as long as it can.
p-code-runnermeasures the tabs and both forms of the buttons; when they do not fit, the run buttons (Run, Debug, Run doctests, Stop, Stop debugging) turn into 32px icon buttons with anaria-labeland a tooltip. Below 30rem (p-code-runneris a size container namedpapyros-code-runner) they always are. When even the icons do not fit, for example with many file tabs, the labelled buttons wrap to a row of their own, and the divider never ends a row. The form that is not shown is laid out invisibly (visibility: hidden, absolutely positioned) rather than withdisplay: none, so both forms can be measured; it is not focusable and not in the accessibility tree.Slotted buttons come last: when the row still does not fit with icon run buttons,
p-code-runnersets acompact-slottedattribute on itself, and the host compacts its own buttons with it. Papyros keeps the width of the slotted buttons with and without the attribute, so it does not flip back and forth. In Dodona's sandbox this keeps "Finalize and submit" labelled down to a code runner of about 400px, while Run and Debug are icons from about 500px:Run doctests had the play icon of Run, so the two looked the same as icon buttons; it now has
mdi-script-text-play. The run buttons after the first no longer getref(undefined), which lit-html 3.3.2 (Dodona's version) throws on when a button is removed.This overlaps with #581 (icon buttons on small screens) for the code bar.
A tab supplied by the host.
p-code-runnertakes two new slots:host-tab: the tab's label. The host puts its status icon and text in one element; Papyros lays out the children in a row and colours them like the other tabs.host-tab-panel: the content, rendered and styled by the host (it stays in the host's light DOM, so Dodona's own CSS applies). Papyros puts it in a scrollable panel below the tabs.The tab appears while the
host-tabslot has an element, after the add-file button and a divider. It is part of the file tablist: arrow keys, Home and End move between all tabs, Enter or Space opens one,aria-selectedand the roving tabindex work as for the file tabs. The add-file button sits between the file tabs and the host tab, and a tablist may only contain tabs, so the tablist claims the host tab witharia-owns. The panel is named after the tab's text, and the name follows when the host changes that text or replaces the label element.HOST_TABandCODE_TABare exported, so a host can open the tab withpapyros.io.activeEditorTab = HOST_TAB. Both are symbols, so a file namedcodeorhost-tabopens as a file; every string inactiveEditorTabis a file name. Starting a run selects the code again, as it already did for files, unless the run asks for another tab:papyros.runner.start(mode, { editorTab })takes an optionalRunOptionsobject (exported), andeditorTabis the tab to select instead of the code. A host that debugs a failing test callsstart(RunMode.Debug, { editorTab: HOST_TAB }). SettingactiveEditorTabafterstart()is not reliable, becausestart()selects the tab before its firstawaitand its promise only settles when the run ends. Removing thehost-tabelement while its tab is open selects the code. WhileactiveEditorTabisHOST_TABand the slot is still empty, the code panel and the Code tab show, and the host tab opens once its label arrives. The footer of the code pane keeps showing the run state while the host tab is open; the sentence in the render was a placeholder. The README documents the API.Compact
p-input. In One at a time, the text field and the Enter button are 40px high. The field was 56px (Material's default spacing) and the button stretched along with it. The padding around them is smaller and the button gets a return-key icon, as in the render. The placeholder is shorter ("Type input and press Enter", "Typ invoer en druk op Enter"), andp-inputis a size container: below 25rem the Enter button turns into an icon button with anaria-labeland a tooltip, so the placeholder fits at 358px in both languages. The title and the tabs did not change.Screenshots
The column screenshots come from a test page that sets no Material spacing overrides (Dodona does not set them either). The "Copy to hand-in" button in the
buttonsslot is a 32pxmd-text-buttonthat switches to an icon button through the container query above.600px, before and after: Run and Debug move from below the editor into the tab bar, and the input row goes from 56px to 40px.
Debugging with a host tab "Test #1" open.
358px: icon buttons in one row with the tabs, and the Enter button as an icon; below that, debugging with the host tab open.
The demo header wraps its picker groups.
How to test
yarn build:sw,yarn setup, thenyarn start.buttonsslot from the console: it keeps its label until even the icon buttons leave no room, and thenp-code-runnergetscompact-slotted.runner.querySelector('[slot=host-tab]').remove()while it is open: the Code tab opens. A file namedhost-taborcodeopens in the file viewer.yarn test,yarn lintandyarn typecheckpass. New tests cover the host tab (absent, selected, arrow keys, removed while open, selected before its label arrives, label changes, file names that match the built-in tabs), the tab-bar height inside and outsidep-code-runner, a debug run started with{ editorTab: HOST_TAB }keeping the host tab, the hidden slot while debugging, the icon buttons in a narrow code pane, labelled buttons while they fit, icon buttons when a wide slotted button would wrap the bar, labelled buttons on their own row when icons would not fit either,compact-slottedonly after the run buttons and its removal when the room comes back, a distinct icon per run mode, the 40px input row and the icon Enter button in a narrow input panel.