Skip to content

Fix weird spacing on "Start Session" button in empty console (#14155)#14381

Closed
PGupta-Git wants to merge 1 commit into
posit-dev:mainfrom
PGupta-Git:fix/14155-no-session-running-button-spacing
Closed

Fix weird spacing on "Start Session" button in empty console (#14155)#14381
PGupta-Git wants to merge 1 commit into
posit-dev:mainfrom
PGupta-Git:fix/14155-no-session-running-button-spacing

Conversation

@PGupta-Git

@PGupta-Git PGupta-Git commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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.

Testing

  • 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 posit-dev#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 posit-dev#14155
@PGupta-Git

PGupta-Git commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Hi @jmcphers and @seeM — this is my first time contributing to Positron.

Could a maintainer please approve CI for this fork PR so the checks can run?
Happy to make any changes needed during review. Thanks.

@juliasilge
juliasilge requested a review from dhruvisompura June 22, 2026 13:17
@juliasilge

Copy link
Copy Markdown
Member

Thank you for this PR, @PGupta-Git! 🙌 We will need to apply your commits to a new, non-fork PR because of the problems outlined in #6628

@PGupta-Git

Copy link
Copy Markdown
Contributor Author

Thank you for this PR, @PGupta-Git! 🙌 We will need to apply your commits to a new, non-fork PR because of the problems outlined in #6628

Thank you so much. Please let me know if I need to do anything from my end.

@dhruvisompura

Copy link
Copy Markdown
Contributor

Thanks for this fix @PGupta-Git! 🎉 I've opened up #14445 as a non-fork PR with your changes and am going to close this one out

@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

3 participants