Skip to content

preserve top alignment of help argument names with r-devel - #17622

Merged
kevinushey merged 1 commit into
rel-golden-wattlefrom
bugfix/help-argument-alignment-r-devel
May 14, 2026
Merged

kevinushey merged 1 commit into
rel-golden-wattlefrom
bugfix/help-argument-alignment-r-devel

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Intent

Addresses #17621.

Summary

  • The fix in ensure top alignment for argument names #13477 added a r-arguments-title class to the Arguments section header in R help, then used a sibling-combinator CSS rule (h3.r-arguments-title + table tr td:first-child { vertical-align: top; ... }) to top-align argument names.
  • R 4.6.0 (r-devel) changes the default of getOption("help.htmltoc") to TRUE in tools::httpd(). With toc = TRUE, Rd2HTML writes section headers with an id attribute (e.g. <h3 id='_sec_arguments'>Arguments</h3>). The literal-string regex in SessionHelp.cpp no longer matched, so the class was never added and argument names reverted to vertically-centered.
  • Broaden the regex to capture any attributes on the <h3> and preserve them in the replacement: <h3([^>]*)>Arguments</h3> -> <h3$1 class="r-arguments-title">Arguments</h3>. This handles both pre-4.6 (<h3>Arguments</h3>) and 4.6+ (<h3 id='_sec_arguments'>Arguments</h3>) output.

Test plan

  • Verified locally with a small Boost regex harness that both formats (with/without id, single- and double-quoted) rewrite correctly and non-matching strings pass through.
  • Build rsession: cmake --build build --target rsession.
  • Open ?t.test in the Help pane against R-devel; confirm argument names are top-aligned with their descriptions (Issue #17621).
  • Open ?t.test against R 4.5.x; confirm no regression in the pre-existing behavior.

@kevinushey kevinushey added this to the Golden Wattle milestone May 13, 2026
@posit-snyk-bot

posit-snyk-bot commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (pending decision on whether to include this in Golden Wattle)

Broaden the <h3>Arguments</h3> match so it also handles the id attribute
emitted by R >= 4.6.0 when the dynamic help server includes a table of
contents (the default in r-devel). Without this, the r-arguments-title
class is never added and the CSS rule that top-aligns argument names
never applies.

Addresses #17621.
@kevinushey
kevinushey force-pushed the bugfix/help-argument-alignment-r-devel branch from 3c9ca6d to f3be102 Compare May 13, 2026 21:41
@kevinushey
kevinushey changed the base branch from main to rel-golden-wattle May 13, 2026 21:41
@kevinushey
kevinushey merged commit 2b611f3 into rel-golden-wattle May 14, 2026
8 checks passed
@kevinushey
kevinushey deleted the bugfix/help-argument-alignment-r-devel branch May 14, 2026 15:50
kevinushey added a commit that referenced this pull request May 14, 2026
* update BUILDTYPE to Release for Golden Wattle

* archive NEWS for golden wattle (#17623)

* trim "What's New" section for Golden Wattle release (#17629)

* limit data viewer horizontal overscroll (#17616)

* limit data viewer horizontal overscroll

Reserve room for the rightmost column when computing the table's
horizontal overscroll padding so it stays visible at maximum scroll;
previously the user could scroll every unpinned column off-screen.
Also sync paddingRight and the custom scrollbar thumb at the end of a
column resize drag (applyResizeDelta intentionally skips these on every
mousemove to avoid jank).

Addresses #17612.

* always allow horizontal overscroll in data viewer

Drop the totalTableWidth > viewport.clientWidth gate so the overscroll
padding is computed even when all columns fit in the viewport. This
keeps horizontal scrolling consistently available regardless of how
wide the table is relative to the viewport.

* skip data viewer overscroll padding when no unpinned columns

When every column is pinned (or no columns exist) there is no column
to scroll into view, so the overscroll formula would add
viewport.clientWidth - pinned.totalWidth of right padding for nothing,
producing a phantom horizontal scrollbar and shrinking the body.

getColumnOrder() places pinned columns before unpinned, so the last
columnOrder entry being unpinned is sufficient to confirm an unpinned
column exists. Gate the overscroll computation on that check; otherwise
leave overscroll = 0.

* add NEWS entry

* data viewer: restore column count in status bar (#17617)

* data viewer: restore column count in status bar

Addresses #17613.

The vanilla-JS data viewer rewrite dropped the column count from the
info bar. Reword the info text to include it, and use "rows" instead
of "entries" so it pairs cleanly with "columns".

* data viewer: keep 'entries' wording in info bar

* data viewer: restore 'total' qualifier in info bar text

Reverts an unintended wording change that dropped 'total' from the
column count, which broke the Playwright assertions in
pagination-sorting.test.ts. Also adds 'entries' to the filtered
suffix for clarity.

* add NEWS entry

* preserve top alignment of help argument names with r-devel (#17622)

Broaden the <h3>Arguments</h3> match so it also handles the id attribute
emitted by R >= 4.6.0 when the dynamic help server includes a table of
contents (the default in r-devel). Without this, the r-arguments-title
class is never added and the CSS rule that top-aligns argument names
never applies.

Addresses #17621.

* add scripts/merge-release-branch.sh

Wraps `git merge --no-ff -X no-renames <branch>` plus the post-merge
fixups needed for a rel-* -> main merge:

- Auto-resolve NEWS.md modify/delete by keeping main's version.
- Auto-resolve version/news/os/NEWS-<ver>-<codename>.md add/add by taking
  the rel branch's content (which has any bug-fix entries added after the
  rotation).
- Reset version/BUILDTYPE, version/RELEASE, version/CALENDAR_VERSION to
  HEAD's values to undo git's trivial-merge fast-take in cases where main
  has not modified the file (most notably BUILDTYPE, which silently flips
  Daily -> Release without intervention).

Stages the merge but does not commit it -- the user reviews with
`git diff --staged` and then runs `git commit`.

The earlier attempt to handle BUILDTYPE via a `merge=ours` driver in
.gitattributes does not work for this scenario: git only consults merge
drivers for true three-way merges (where both sides modified the file),
not for the one-sided trivial merge that BUILDTYPE actually hits.

* restore main's full whats-new/golden-wattle/index.html

The merge of rel-golden-wattle into main applied the trim from #17629,
which curated the What's New content for the release announcement.
Revert that on main so main retains the full pre-trim content; the
trimmed version remains on the rel branch where it ships.

---------

Co-authored-by: Skye Turriff <[email protected]>
Co-authored-by: Gary Ritchie <[email protected]>
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.

3 participants