Skip to content

fix(terminal): tables keep their columns, blank lines show, the tutor button no longer hides keys - #397

Merged
thierryvm merged 1 commit into
mainfrom
fix/terminal-output-layout
Sep 29, 2026
Merged

thierryvm merged 1 commit into
mainfrom
fix/terminal-output-layout

Conversation

@thierryvm

@thierryvm thierryvm commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

This PR fixes three display defects in the lesson terminal. They showed up in the visual check of #396: mobile 390px, tablet 1024px (touch) and desktop 1280px, in a local Chrome session. None of them was new in #396, and all of them affected every learner.

  • Tables keep their columns.
    • The problem: Get-Process, ps, ls -l, Get-ScheduledTask and Get-History were wrapped to the terminal width (whitespace-pre-wrap). On a phone every row broke into pieces, and on desktop the last column wrapped.
    • The fix: segmentOutput (terminalLayout.ts) groups consecutive column lines. A column line has 2 or more spaces between words, or is a dash rule. The group is rendered unwrapped in TerminalColumns, which scrolls sideways.
    • What still wraps: a lone line of names (plain ls, Tab completion) and git status entries (tab-indented). This is how a real terminal reflows them.
    • Scroll cue: iOS shows no scrollbar at rest, so a right-edge fade shows that there is more to the right.
    • Keyboard access: the block becomes a focusable region, named after its header row, only when it overflows.
  • Blank lines are visible again. An empty div had no height, so Get-Help sections and PowerShell tables lost their spacing. Each line now has min-h-5.
  • The AI tutor FAB no longer covers the touch key bar.
    • Measured: at 390px the FAB was 96→140px from the bottom, over the bar at 86→142px.
    • Lifting the FAB higher made it cover the input line, so the fix goes the other way: the key bar reserves pe-16 at its end, via reserveKeyBarEnd={isAiTutorEnabled()}. The FAB now sits at the end of the bar like one more key.
    • Measured after the fix: bar ends at 309px and the FAB starts at 322px (390 touch); bar ends at 943px and the FAB starts at 952px (1024 touch).
  • No iPad focus zoom. The terminal input stays at 16px on touch screens (md:pointer-fine:text-sm). Safari zooms on focus below 16px.

Reviews

  • ui-auditor: 0 CRITICAL. W1 is fixed: the focus ring now uses the ring token at 2px instead of emerald at 1px. W4 is fixed: region and the tab stop are added only when the table overflows.
  • mobile-responsive-auditor: PASS_WITH_NOTES, 0 CRITICAL. Fixed: the scroll cue (fade), overscroll-x-contain, and the iPad zoom.
    • Still needs a real iPhone: FAB and key bar alignment while the iOS keyboard is open (visual-viewport panning). Chrome emulation cannot show it.
  • feature-dev:code-reviewer: 1 IMPORTANT and 4 MINOR findings, all fixed with tests.
    • IMPORTANT: plain ls and Tab lists were treated as tables. A table now needs 2 or more rows.
    • MINOR: git status tab lines are excluded; the segment key is stable (last row id); the content box is observed; each region gets a specific label.
  • Playwright accessibility.spec.ts (chromium): the landing-page tests time out on main too (6 failures on main, 5 on this branch). The failure is pre-existing and not related to this PR; it will be tracked separately.

Test plan

  • tsc --noEmit, eslint src, vitest run (2791 passed), vite build
  • New terminalLayout.test.tsx: segmentation, ls single line, git status lines, the real Get-History table, TerminalColumns tab stop and region, key bar reserve
  • Chrome (local): 390 touch, 1024 touch, 1280 desktop. No horizontal page overflow; Linux ls and ls -la, PowerShell Get-Process, Get-History and Get-Help checked
  • CI green, preview smoke test, production check after merge

🤖 Generated with Claude Code

Résumé par Sourcery

Amélioration de la lisibilité du terminal et de la mise en page sur les écrans tactiles pour les appareils mobiles, les tablettes et les ordinateurs de bureau.

Corrections de bugs :

  • Préserver l’alignement des colonnes des tableaux du terminal avec un défilement horizontal, tout en permettant au texte ordinaire et aux listes de revenir naturellement à la ligne.
  • Rétablir l’espacement visible des lignes vides dans la sortie du terminal.
  • Empêcher le bouton du tuteur IA de recouvrir la barre de raccourcis du terminal sur mobile.
  • Empêcher le zoom de Safari sur iPad déclenché par la mise au point en conservant la taille du texte du terminal tactile à 16px.

Améliorations :

  • Ajouter des indicateurs de débordement et des régions accessibles au clavier de manière conditionnelle pour les tableaux larges du terminal.

Documentation :

  • Documenter les améliorations de l’affichage du terminal dans le journal des modifications et la présentation du projet.

Tests :

  • Ajouter une couverture de tests pour la segmentation de la sortie du terminal, l’accessibilité des tableaux, la gestion des lignes vides, l’espacement entre le tuteur et la barre, ainsi que le comportement réactif du terminal.
Original summary in English

Summary by Sourcery

Improve terminal readability and touch-screen layout across mobile, tablet, and desktop displays.

Bug Fixes:

  • Preserve aligned terminal table columns with horizontal scrolling while allowing ordinary text and lists to wrap naturally.
  • Restore visible spacing for blank terminal output lines.
  • Prevent the AI tutor button from covering the mobile terminal shortcut bar.
  • Prevent focus-triggered iPad Safari zoom by keeping touch terminal text at 16px.

Enhancements:

  • Add overflow cues and conditional keyboard-accessible regions for wide terminal tables.

Documentation:

  • Document the terminal display improvements in the changelog and project story.

Tests:

  • Add coverage for terminal output segmentation, table accessibility, blank-line handling, tutor-bar spacing, and responsive terminal behavior.

… button no longer hides keys

Found in the visual check of #396 on mobile, tablet and desktop:

- Lines laid out in columns (Get-Process, ps, ls -l, Get-History) are
  grouped by segmentOutput and shown unwrapped in TerminalColumns, which
  scrolls sideways with a right-edge fade and becomes a labelled focusable
  region only when it overflows. A lone line of names (ls, Tab completion)
  and git status entries keep wrapping.
- Blank output lines keep their height (an empty div collapsed to nothing).
- The touch key bar reserves its end for the AI tutor button, which covered
  the last keys (reserveKeyBarEnd, isAiTutorEnabled).
- The terminal input stays 16px on touch screens (iPad Safari focus zoom).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
terminal-learning Ready Ready Preview Sep 29, 2026 3:49pm UTC

@sourcery-ai sourcery-ai 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.

Sorry @thierryvm, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 7 hours and 39 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Guide du réviseur

La PR met à jour la mise en page de la sortie du terminal afin de préserver les tableaux de commandes sur plusieurs lignes dans des blocs défilables horizontalement, de restaurer la hauteur des lignes vides et d’ajouter des indicateurs d’accessibilité en cas de dépassement, tout en réservant de l’espace dans la barre de raccourcis pour le FAB du tuteur IA et en maintenant une taille de saisie tactile de 16 px pour empêcher le zoom sur iPad ; les tests couvrent la segmentation, le comportement du rendu et la réservation de la barre de touches.

Diagramme d’état des tableaux de terminal défilables horizontalement

stateDiagram-v2
    [*] --> Fits
    Fits --> Overflowing: content width exceeds container
    Overflowing --> Scrolled: user scrolls horizontally
    Scrolled --> Overflowing: not at end
    Scrolled --> AtEnd: reaches end
    Overflowing --> Fits: container or content resize
    AtEnd --> Overflowing: content changes or scrolls back
Loading

Diagramme de flux de la segmentation de la sortie du terminal

flowchart LR
    Lines[Terminal output lines] --> Segment[segmentOutput]
    Segment -->|Two or more column rows| Columns[TerminalColumns]
    Columns --> Scroll[Horizontal scroll]
    Columns --> Cue[Right-edge fade and conditional region tab stop]
    Segment -->|Prose, lone lists, prompts, git status| Wrapped[Wrapped terminal lines]
    Segment -->|Blank lines| Spaced[Visible min-h-5 lines]
Loading

Modifications au niveau des fichiers

Modification Détails Fichiers
Préserver la mise en page des tableaux du terminal tout en conservant le retour à la ligne naturel pour les sorties qui ne sont pas des tableaux.
  • Détecter et segmenter les lignes consécutives en colonnes, en excluant les entrées d’état git indentées avec des tabulations et en exigeant plusieurs lignes.
  • Afficher les segments de tableaux dans des blocs non renvoyés à la ligne et défilables horizontalement, avec détection du dépassement, fondu sur le bord droit, focus clavier et libellés accessibles.
  • Garder les lignes vides visibles et utiliser des clés de segment stables pour l’historique de défilement limité.
src/app/components/terminalLayout.ts
src/app/components/TerminalColumns.tsx
src/app/components/TerminalEmulator.tsx
src/test/terminalLayout.test.tsx
Empêcher le bouton du tuteur IA de masquer la barre de raccourcis du terminal sur les interfaces tactiles.
  • Exposer le feature flag du tuteur et transmettre une propriété de réservation depuis la page de leçon.
  • Réserver un espace de remplissage à l’extrémité de la barre de touches et repositionner son indicateur de défilement lorsque le tuteur est activé.
src/app/components/ai/AiTutorPanel.tsx
src/app/components/LessonPage.tsx
src/app/components/TerminalEmulator.tsx
src/app/components/TerminalKeyBar.tsx
src/test/terminalLayout.test.tsx
Éviter le zoom lors du focus dans Safari sur les appareils tactiles tout en documentant les corrections d’affichage.
  • Conserver le texte de l’invite et de la saisie du terminal à 16 px sur les appareils à pointeur grossier, tout en conservant un texte plus petit pour les pointeurs fins.
  • Ajouter des entrées au journal des modifications et au récit du projet couvrant le défilement des tableaux, l’espacement des lignes vides, la mise en page de la barre du tuteur et le comportement du zoom sur iPad.
src/app/components/TerminalEmulator.tsx
CHANGELOG.md
STORY.md

Conseils et commandes

Interagir avec Sourcery

  • Déclencher une nouvelle revue : commentez @sourcery-ai review sur la pull request.
  • Poursuivre les discussions : répondez directement aux commentaires de revue de Sourcery.
  • Générer une issue GitHub à partir d’un commentaire de revue : demandez à Sourcery de créer une issue à partir d’un commentaire de revue en y répondant. Vous pouvez également répondre à un commentaire de revue avec @sourcery-ai issue pour créer une issue à partir de celui-ci.
  • Générer le titre d’une pull request : écrivez @sourcery-ai n’importe où dans le titre de la pull request pour générer un titre à tout moment. Vous pouvez également commenter @sourcery-ai title sur la pull request pour générer ou régénérer le titre à tout moment.
  • Générer le résumé d’une pull request : écrivez @sourcery-ai summary n’importe où dans le corps de la pull request pour générer un résumé de PR à tout moment, exactement à l’endroit souhaité. Vous pouvez également commenter @sourcery-ai summary sur la pull request pour générer ou régénérer le résumé à tout moment.
  • Générer le guide du réviseur : commentez @sourcery-ai guide sur la pull request pour générer ou régénérer le guide du réviseur à tout moment.
  • Résoudre tous les commentaires de Sourcery : commentez @sourcery-ai resolve sur la pull request pour résoudre tous les commentaires de Sourcery. Cette commande est utile si vous avez déjà traité tous les commentaires et ne souhaitez plus les voir.
  • Rejeter toutes les revues de Sourcery : commentez @sourcery-ai dismiss sur la pull request pour rejeter toutes les revues de Sourcery existantes. Particulièrement utile si vous souhaitez recommencer avec une nouvelle revue : n’oubliez pas de commenter @sourcery-ai review pour déclencher une nouvelle revue !

Personnaliser votre expérience

Accédez à votre tableau de bord pour :

  • Activer ou désactiver les fonctionnalités de revue, telles que le résumé de pull request généré par Sourcery, le guide du réviseur et d’autres fonctionnalités.
  • Modifier la langue de revue.
  • Ajouter, supprimer ou modifier les instructions de revue personnalisées.
  • Ajuster les autres paramètres de revue.

Obtenir de l’aide

Original review guide in English

Reviewer's Guide

The PR updates terminal output layout to preserve multi-row command tables in horizontally scrollable blocks, restore blank-line height, and add overflow accessibility cues, while reserving shortcut-bar space for the AI tutor FAB and maintaining a 16px touch input size to prevent iPad zoom; tests cover segmentation, rendering behavior, and key-bar reservation.

State diagram for horizontally scrollable terminal tables

stateDiagram-v2
    [*] --> Fits
    Fits --> Overflowing: content width exceeds container
    Overflowing --> Scrolled: user scrolls horizontally
    Scrolled --> Overflowing: not at end
    Scrolled --> AtEnd: reaches end
    Overflowing --> Fits: container or content resize
    AtEnd --> Overflowing: content changes or scrolls back
Loading

Flow diagram for terminal output segmentation

flowchart LR
    Lines[Terminal output lines] --> Segment[segmentOutput]
    Segment -->|Two or more column rows| Columns[TerminalColumns]
    Columns --> Scroll[Horizontal scroll]
    Columns --> Cue[Right-edge fade and conditional region tab stop]
    Segment -->|Prose, lone lists, prompts, git status| Wrapped[Wrapped terminal lines]
    Segment -->|Blank lines| Spaced[Visible min-h-5 lines]
Loading

File-Level Changes

Change Details Files
Preserve terminal table layout while retaining natural wrapping for non-table output.
  • Detect and segment consecutive columnar rows, excluding tab-indented git status entries and requiring multiple rows.
  • Render table segments in horizontally scrollable, unwrapped blocks with overflow detection, right-edge fade, keyboard focus, and accessible labels.
  • Keep blank lines visible and use stable segment keys for capped scrollback.
src/app/components/terminalLayout.ts
src/app/components/TerminalColumns.tsx
src/app/components/TerminalEmulator.tsx
src/test/terminalLayout.test.tsx
Prevent the AI tutor button from obscuring the terminal shortcut bar on touch layouts.
  • Expose the tutor feature flag and pass a reservation prop from the lesson page.
  • Reserve end padding in the key bar and reposition its scroll cue when the tutor is enabled.
src/app/components/ai/AiTutorPanel.tsx
src/app/components/LessonPage.tsx
src/app/components/TerminalEmulator.tsx
src/app/components/TerminalKeyBar.tsx
src/test/terminalLayout.test.tsx
Avoid Safari focus zoom on touch devices while documenting the display fixes.
  • Keep terminal prompt and input text at 16px on coarse-pointer devices while retaining smaller text for fine pointers.
  • Add changelog and project-story entries covering table scrolling, blank-line spacing, tutor-bar layout, and iPad zoom behavior.
src/app/components/TerminalEmulator.tsx
CHANGELOG.md
STORY.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@thierryvm
thierryvm merged commit dd68fab into main Sep 29, 2026
4 checks passed
@thierryvm
thierryvm deleted the fix/terminal-output-layout branch September 29, 2026 15:51

This branch was successfully deployed

1 active deployment
Preview — 6e7ac3df Deployed Sep 29, 2026 by vercel[bot]
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.

1 participant