DiamondLightSource / DiamondLightSource/sci-react-ui

Change Proposal: Apply `DiamondDSIntegrations` MRT styling automatically to all tables, not just opted-in ones

オープン
#280 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
needs-triage
主要言語
TypeScript
スター
8
フォーク
3
平均マージ
3日 15時間
マージ済み PR(30日)
5

説明

## What is being proposed?

A wrapper or a component that pre-merges `DiamondDSIntegrations.mrtTheme` / `mrtOptions()` so every Material React Table instance in a consuming app picks up DiamondDS styling by default, instead of requiring each call site to use it individually.

## Why is this needed?

#249 added `DiamondDSIntegrations.mrtTheme` / `mrtOptions()`, but they only apply if a developer remembers to use them into a given `useMaterialReactTable` call. If they don't, the table silently falls back to MRT's unstyled defaults, with no error or warning, so styling drifts table-by-table across an app instead of being guaranteed by the design system. This was flagged as a follow-up TODO directly in `src/themes/DiamondDSIntegrations.ts`.

## What will change?

- **Behaviour:** DiamondDS table styling becomes the default for MRT tables rather than opt-in per instance.
- **Component props or usage:** likely a new hook/wrapper is introduced; existing manual `mrtOptions()`/`mrtTheme` spreading should keep working for anyone not yet migrated.
- **New component:** possibly a thin wrapper around `useMaterialReactTable` or `MaterialReactTable`.

## Interface changes (if any)

```ts
// wraps useMaterialReactTable and merges DiamondDS defaults automatically
const table = useDiamondMaterialReactTable({
columns,
data,
// any options here still override the DiamondDS defaults
});
```

## Breaking change?

- [ ] Yes
- [x] No

Additive: existing code that manually uses `mrtOptions()`/`mrtTheme` continues to work; the new hook/wrapper is the recommended path going forward.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

src/themes/DiamondDSIntegrations.ts の TODO から始め、useMaterialReactTable と MaterialReactTable がどのように使われているかを確認します。提案された hook または wrapper のオプションを比較し、manual mrtOptions()/mrtTheme の使用を維持するとともに、caller のオプションが DiamondDS のデフォルトを上書きすることを確認します。MRT テーブルが新しい推奨パスを通じて一貫してスタイルを受け取れるようになれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react, typescript
領域
frontend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。