Skip to content

Migrate Col, Row and Grid from react-bootstrap to custom implementations#26191

Open
dennisoelkers wants to merge 4 commits into
masterfrom
migrate-col-row-to-mantine
Open

Migrate Col, Row and Grid from react-bootstrap to custom implementations#26191
dennisoelkers wants to merge 4 commits into
masterfrom
migrate-col-row-to-mantine

Conversation

@dennisoelkers
Copy link
Copy Markdown
Member

Description

Replaces the react-bootstrap Col, Row and Grid components used throughout the web interface with custom implementations:

  • Col and Row are now plain styled-components that reproduce Bootstrap 3's grid CSS directly — 30px gutter, 12-column grid, float-based columns, and the @screen-sm = @screen-md = 992px breakpoint collapse — using the values from public/stylesheets/bootstrap-config.json (the RB config this codebase compiles).
  • Grid wraps Mantine's Container, with fluid defaulted to true and pinned to RB's metrics (max-width: none, padding: 0 15px).

The existing prop API (xs/sm/md/lg plus the matching *Offset and *Hidden flags, componentClass, and the className="content" card styling) is preserved, so the ~668 <Col> and ~444 <Row> call sites do not change.

Motivation and Context

Part of the ongoing effort to remove our dependency on react-bootstrap, following the earlier HelpBlock, Tabs and Pagination migrations. Owning these grid primitives lets us drop another chunk of the Bootstrap surface without touching call sites.

How Has This Been Tested?

  • Added Col.test.tsx covering the column/offset/hidden prop behavior.
  • yarn tsc, yarn lint:changes and yarn test pass locally.
  • Visually verified that grid-based layouts render identically against the previous Bootstrap output.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

/nocl Internal refactor migrating grid components off react-bootstrap; prop API and rendered output preserved, no user-facing change.

…ementations.

`Col` and `Row` are now plain styled-components that reproduce Bootstrap 3's
grid CSS directly — 30px gutter, 12-column grid, float-based columns, the
`@screen-sm = @screen-md = 992px` breakpoint collapse — using the values
from `public/stylesheets/bootstrap-config.json` (the RB config this
codebase compiles). `Grid` wraps Mantine's `Container` with `fluid`
defaulted to true and pinned to RB's metrics (`max-width: none`,
`padding: 0 15px`).

The existing prop API (`xs`/`sm`/`md`/`lg` + the matching `*Offset` and
`*Hidden` flags, plus `componentClass` and the `className="content"` card
styling) is preserved, so the ~668 `<Col>` and ~444 `<Row>` call sites do
not change.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@dennisoelkers dennisoelkers added the e2e-tests Run PR build with e2e tests. label Jun 2, 2026
dennisoelkers and others added 3 commits June 2, 2026 08:32
- `xsPush`/`smPush`/`mdPush`/`lgPush` and the matching `*Pull` props on
  `Col` implement Bootstrap 3's column-reordering rules (`left`/`right`
  inside the appropriate breakpoint media query). Enterprise consumers
  use these.
- `Col` and `Row` are wrapped in `React.forwardRef<HTMLDivElement>` so
  callers can attach a ref to the rendered element.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Refactor `Col` and `Row` to define the component as a named function with an
explicit `: Props` parameter annotation, wrapped with `forwardRef`. The react
ESLint plugin cannot trace default parameters through the inline
`forwardRef<T, Props>((props, ref) => …)` generic form, which flagged every
optional prop. This matches the existing pattern used by `ListGroupItem` and
`Checkbox`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`postcss-styled-syntax` does not treat a styled-component template root as a
scoping root, so idiomatic root-level `&` selectors (e.g. `&::before`,
`&.content`) are reported as false positives by this `stylelint-config-standard`
rule.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dennisoelkers dennisoelkers requested a review from linuspahl June 4, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e-tests Run PR build with e2e tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant