Skip to content

Commit 0647890

Browse files
committed
fix: small review fixes
1 parent ec9b36f commit 0647890

File tree

11 files changed

+25
-63
lines changed

11 files changed

+25
-63
lines changed

.github/copilot-instructions.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Copilot Instructions
2+
3+
## Internationalization (i18n)
4+
5+
- Do NOT hardcode user-facing strings.
6+
- ALWAYS use the component i18n keysets.
7+
- For key naming, see `i18n-naming-ruleset.md` in the repo root.
8+
19
# GitHub Copilot Instructions for YDB Embedded UI
210

311
> **Note**: This file contains project-specific instructions for GitHub Copilot code review and assistance.

AGENTS.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -232,21 +232,7 @@ Uses BEM naming convention with `cn()` utility from `utils/cn`. Create a block f
232232

233233
### Internationalization (i18n)
234234

235-
All user-facing text must be internationalized using the i18n system. Follow the naming rules from `i18n-naming-ruleset.md`:
236-
237-
- **Component Structure**: Each component has an `i18n/` folder with `en.json` and `index.ts`
238-
- **Registration**: Use `registerKeysets()` with a unique component name
239-
- **Key Format**: Follow `<context>_<content>` pattern (e.g., `action_save`, `field_name`, `alert_error`)
240-
- **Context Prefixes**:
241-
- `action_` - buttons, links, menu items
242-
- `field_` - form fields, table columns
243-
- `title_` - page/section titles
244-
- `alert_` - notifications, errors
245-
- `context_` - descriptions, hints
246-
- `confirm_` - confirmation dialogs
247-
- `value_` - status values, options
248-
- **NEVER** use hardcoded strings in UI components
249-
- **ALWAYS** create i18n entries for all user-visible text
235+
See `i18n-naming-ruleset.md` in the repo root for all i18n conventions (naming and usage).
250236

251237
### Performance Considerations
252238

CLAUDE.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -232,21 +232,7 @@ Uses BEM naming convention with `cn()` utility from `utils/cn`. Create a block f
232232

233233
### Internationalization (i18n)
234234

235-
All user-facing text must be internationalized using the i18n system. Follow the naming rules from `i18n-naming-ruleset.md`:
236-
237-
- **Component Structure**: Each component has an `i18n/` folder with `en.json` and `index.ts`
238-
- **Registration**: Use `registerKeysets()` with a unique component name
239-
- **Key Format**: Follow `<context>_<content>` pattern (e.g., `action_save`, `field_name`, `alert_error`)
240-
- **Context Prefixes**:
241-
- `action_` - buttons, links, menu items
242-
- `field_` - form fields, table columns
243-
- `title_` - page/section titles
244-
- `alert_` - notifications, errors
245-
- `context_` - descriptions, hints
246-
- `confirm_` - confirmation dialogs
247-
- `value_` - status values, options
248-
- **NEVER** use hardcoded strings in UI components
249-
- **ALWAYS** create i18n entries for all user-visible text
235+
See `i18n-naming-ruleset.md` in the repo root for all i18n conventions (naming and usage).
250236

251237
### Performance Considerations
252238

src/components/nodesColumns/columns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function getRackColumn<T extends {Rack?: string}>(): Column<T> {
114114
export function getPileNameColumn<T extends {PileName?: string}>(): Column<T> {
115115
return {
116116
name: NODES_COLUMNS_IDS.PileName,
117-
header: i18n('PileName'),
117+
header: i18n('field_pile-name'),
118118
align: DataTable.LEFT,
119119
render: ({row}) => row.PileName || EMPTY_DATA_PLACEHOLDER,
120120
width: 100,

src/components/nodesColumns/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const NODES_COLUMNS_TITLES = {
132132
return i18n('pdisks');
133133
},
134134
get PileName() {
135-
return i18n('PileName');
135+
return i18n('field_pile-name');
136136
},
137137
} as const satisfies Record<NodesColumnId, string>;
138138

@@ -183,7 +183,7 @@ const NODES_COLUMNS_GROUP_BY_TITLES = {
183183
return i18n('ping-time');
184184
},
185185
get PileName() {
186-
return i18n('PileName');
186+
return i18n('field_pile-name');
187187
},
188188
} as const satisfies Record<NodesGroupByField, string>;
189189

src/components/nodesColumns/i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"pdisks": "PDisks",
2121
"field_memory-used": "Memory used",
2222
"field_memory-limit": "Memory limit",
23-
"PileName": "Pile Name",
23+
"field_pile-name": "Pile Name",
2424
"system-state": "System State",
2525
"connect-status": "Connect Status",
2626
"utilization": "Utilization",

src/containers/Cluster/ClusterInfo/ClusterInfo.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
margin-left: 5px;
2222
}
2323

24-
&__details-layout {
25-
align-items: flex-start;
26-
gap: var(--g-spacing-6);
27-
}
28-
2924
&__bridge-table {
3025
flex: 0 0 360px; // do not shrink, fixed basis so stats don't take all space
3126

src/containers/Cluster/ClusterInfo/ClusterInfo.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import {getInfo, getStorageGroupStats} from './utils/utils';
2020

2121
import './ClusterInfo.scss';
2222

23-
const GROUPS_SECTION_GAP = 10;
24-
2523
interface ClusterInfoProps {
2624
cluster?: TClusterInfo;
2725
loading?: boolean;
@@ -101,7 +99,7 @@ export const ClusterInfo = ({
10199
}
102100
return (
103101
<InfoSection>
104-
<Flex gap={GROUPS_SECTION_GAP} width="full">
102+
<Flex gap={10} width="full">
105103
<Flex direction="column" gap={2}>
106104
<Text as="div" variant="subheader-2" className={b('section-title')}>
107105
{i18n('title_storage-groups')}{' '}

src/containers/Cluster/ClusterOverview/components/BridgeInfoTable.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@ export function BridgeInfoTable({piles}: BridgeInfoTableProps) {
1919
() => [
2020
{
2121
name: 'Name',
22-
header: i18n('label_name'),
22+
header: i18n('field_name'),
2323
width: 160,
2424
align: DataTable.LEFT,
2525
},
2626
{
2727
name: 'IsPrimary',
28-
header: i18n('label_primary'),
28+
header: i18n('field_primary'),
2929
width: 110,
3030
align: DataTable.LEFT,
3131
render: ({row}) => (row.IsPrimary ? i18n('value_yes') : i18n('value_no')),
3232
},
3333
{
3434
name: 'State',
35-
header: i18n('label_state'),
35+
header: i18n('field_state'),
3636
width: 160,
3737
align: DataTable.LEFT,
3838
},
3939
{
4040
name: 'Nodes',
41-
header: i18n('label_nodes'),
41+
header: i18n('field_nodes'),
4242
width: 100,
4343
align: DataTable.RIGHT,
4444
render: ({row}) =>

src/containers/Cluster/i18n/en.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"title_bridge": "Bridge Piles",
2121
"label_overview": "Overview",
2222
"label_load": "Load",
23-
"label_name": "Name",
24-
"label_primary": "Primary",
25-
"label_state": "State",
26-
"label_nodes": "Nodes",
23+
"field_name": "Name",
24+
"field_primary": "Primary",
25+
"field_state": "State",
26+
"field_nodes": "Nodes",
2727
"value_yes": "Yes",
2828
"value_no": "No",
2929
"context_of": "of",

0 commit comments

Comments
 (0)