Migrate Col, Row and Grid from react-bootstrap to custom implementations#26191
Open
dennisoelkers wants to merge 4 commits into
Open
Migrate Col, Row and Grid from react-bootstrap to custom implementations#26191dennisoelkers wants to merge 4 commits into
Col, Row and Grid from react-bootstrap to custom implementations#26191dennisoelkers wants to merge 4 commits into
Conversation
…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>
- `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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replaces the
react-bootstrapCol,RowandGridcomponents used throughout the web interface with custom implementations:ColandRoware 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 = 992pxbreakpoint collapse — using the values frompublic/stylesheets/bootstrap-config.json(the RB config this codebase compiles).Gridwraps Mantine'sContainer, withfluiddefaulted totrueand pinned to RB's metrics (max-width: none,padding: 0 15px).The existing prop API (
xs/sm/md/lgplus the matching*Offsetand*Hiddenflags,componentClass, and theclassName="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 earlierHelpBlock,TabsandPaginationmigrations. Owning these grid primitives lets us drop another chunk of the Bootstrap surface without touching call sites.How Has This Been Tested?
Col.test.tsxcovering the column/offset/hidden prop behavior.yarn tsc,yarn lint:changesandyarn testpass locally.Screenshots (if appropriate):
Types of changes
Checklist:
/nocl Internal refactor migrating grid components off react-bootstrap; prop API and rendered output preserved, no user-facing change.