Skip to content

Fix weird spacing on Start Session button in empty console - #14445

Merged
dhruvisompura merged 3 commits into
mainfrom
fix/console-start-session-button-spacing
Jun 23, 2026
Merged

dhruvisompura merged 3 commits into
mainfrom
fix/console-start-session-button-spacing

Conversation

@dhruvisompura

@dhruvisompura dhruvisompura commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

This is a non-fork PR applying the commits from #14381 by @PGupta-Git because of the problems outlined in #14155.

Fixes #14155

Description

Fixes the weird spacing around the Start Session button in the Console when no session is running.

Root Cause

This was introduced in #12795 which replaced PositronButton (a <div role="button"> with zero browser-default padding) with the Button component (a native <button> element).

Native <button> elements have browser UA stylesheet default padding (1px 6px). When used inline within a text sentence — "There is no session running. Use [Start Session] to start one." — this padding creates unwanted vertical and horizontal whitespace around the button text, making it look like a hyperlink with extra internal spacing.

Fix

Added two CSS properties to the .link rule in emptyConsole.css:

padding: 0;           /* remove browser default button padding */
vertical-align: baseline; /* keep button text aligned with surrounding text */

This resets the UA default padding for the button in this specific inline-text context only (scoped to .empty-console .title .link), without affecting the Button component globally.

Release Notes

New Features

  • N/A

Bug Fixes

Validation Steps

@:console
@:sessions

  • Existing Vitest unit tests in emptyConsole.vitest.tsx continue to pass — they verify the text content and click behavior, which are unaffected.
  • Visually: open a new Positron window before any session is started and confirm the "Start Session" button text sits flush with the surrounding sentence text.

The Button component renders a native <button> element which has
browser UA default padding (1px 6px). When used inline within a
text sentence ("There is no session running. Use [Start Session]
to start one."), this padding creates unwanted vertical and
horizontal whitespace around the button text.

This was introduced in #12795 which replaced PositronButton (a
<div role='button'> with no default browser padding) with the
Button component (a native <button>).

Fix by adding padding: 0 and vertical-align: baseline to the
.link class in emptyConsole.css, which resets the browser
default button padding and keeps the button text aligned with
the surrounding text.

Fixes #14155
@github-actions

Copy link
Copy Markdown

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:console @:sessions

readme  valid tags

@github-actions

Copy link
Copy Markdown

PETE's assessment 🧪

Verdict: 🟡 Not applicable -- the change is a 2-line CSS tweak (padding: 0; vertical-align: baseline;) that adjusts visual spacing only, with no testable behavior change.

What changed

  • Added padding: 0 and vertical-align: baseline to the .empty-console .title .link rule in emptyConsole.css to reset the native <button> UA padding so the inline "Start Session" button sits flush with surrounding text. No TypeScript, markup, or logic touched.

Tests in this PR

  • Unit (Vitest/Mocha) ✅ (not applicable -- CSS-only; existing emptyConsole.vitest.tsx still covers render + click)
  • Extension host ✅ (not applicable)
  • E2E (Playwright) ✅ (not applicable -- visual spacing, not a workflow)

Existing coverage

src/vs/workbench/contrib/positronConsole/test/browser/emptyConsole.vitest.tsx already asserts the empty-state message renders, the Start Session button renders, and pressing it executes startNewConsoleSession. These behaviors are unchanged by a CSS padding/alignment reset, so they remain valid. Pixel-level spacing isn't expressible as a Vitest/RTL assertion and doesn't justify an e2e test for a cosmetic fix.

Suggested additions

None.


PETE (Positron Extreme Test Experiment) - LLM-based test-coverage advisor, in pilot. Triggers on PR open and on /recheck-tests comments. Wrong verdict? Comment /recheck-tests (or /rePETE) on this PR to re-run. Please share feedback on how PETE performed here.

@dhruvisompura
dhruvisompura marked this pull request as ready for review June 23, 2026 22:51
@dhruvisompura
dhruvisompura enabled auto-merge (squash) June 23, 2026 22:51
@dhruvisompura
dhruvisompura disabled auto-merge June 23, 2026 22:51
@dhruvisompura
dhruvisompura enabled auto-merge (squash) June 23, 2026 22:53
@dhruvisompura
dhruvisompura disabled auto-merge June 23, 2026 23:33
@dhruvisompura
dhruvisompura merged commit 1572780 into main Jun 23, 2026
32 checks passed
@dhruvisompura
dhruvisompura deleted the fix/console-start-session-button-spacing branch June 23, 2026 23:33
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console UI: "no session running" button has weird spacing

2 participants