Skip to content

Commit 780677d

Browse files
authored
Merge pull request #6 from jeff-phillips-18/updates
Update AI documentation with various fixes and additions and rename documentation directory
2 parents 38bb322 + f6bb004 commit 780677d

File tree

20 files changed

+205
-32
lines changed

20 files changed

+205
-32
lines changed

.cursor/rules/patternfly-vibe-coding.mdc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ This rule applies to all code generation, refactoring, and review tasks involvin
1313

1414
## Documentation to Reference
1515
- The root `README.md`
16-
- The `documentation/README.md` file, which serves as the table of contents for all documentation in the `documentation/` directory and its subdirectories. Use this file to discover and navigate all relevant rules, guidelines, and best practices for PatternFly development.
17-
- All markdown files referenced by `documentation/README.md`.
16+
- The `.pf-ai-documentation/README.md` file, which serves as the table of contents for all documentation in the `.pf-ai-documentation/` directory and its subdirectories. Use this file to discover and navigate all relevant rules, guidelines, and best practices for PatternFly development.
17+
- All markdown files referenced by `.pf-ai-documentation/README.md`.
1818

1919
## Rule
2020
- **Always consult the above documentation before generating or editing any PatternFly code.**
File renamed without changes.
Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ npm install @patternfly/react-charts victory
1515

1616
# ✅ ECharts-based charts (alternative)
1717
npm install @patternfly/react-charts echarts
18+
19+
# ✅ Patternfly for charts css variables (recommended)
20+
npm install @patternfly/patternfly
1821
```
1922

2023
### Import Rules
@@ -31,6 +34,12 @@ import { EChart } from '@patternfly/react-charts/echarts';
3134
import { ChartDonut } from '@patternfly/react-charts';
3235
```
3336

37+
### Import PatternFly Charts CSS
38+
```jsx
39+
// In your main App.js or index.js
40+
import '@patternfly/patternfly/patternfly-charts.css';
41+
```
42+
3443
### Critical Import Path Troubleshooting
3544

3645
**⚠️ MOST COMMON ISSUE**: Chart components cannot be found
@@ -77,9 +86,9 @@ Module not found: Can't resolve '@patternfly/react-charts'
7786
```jsx
7887
// ✅ Correct - Use PatternFly color tokens
7988
const chartColors = [
80-
'var(--pf-v6-chart-color-blue-300)',
81-
'var(--pf-v6-chart-color-green-300)',
82-
'var(--pf-v6-chart-color-orange-300)'
89+
'var(--pf-t--chart--color--blue--300)',
90+
'var(--pf-t--chart--color--green--300)',
91+
'var(--pf-t--chart--color--orange--300)'
8392
];
8493
8594
<ChartDonut data={data} colorScale={chartColors} />
@@ -210,6 +219,23 @@ const LazyChart = lazy(() => import('./HeavyChart'));
210219
- **Implement lazy loading**: For heavy chart components
211220
- **Optimize re-renders**: Use React.memo for chart components
212221
222+
#### Issue: Chart colors not correct
223+
```bash
224+
# Symptoms: Chart color variables (--pf-v6-chart-color-blue-100, --pf-t--chart--color--blue--300) are not defined
225+
```
226+
227+
**Solutions**:
228+
1. **Install patternfly package**:
229+
```bash
230+
npm install @patternfly/patternfly
231+
```
232+
233+
2. **Import PatternFly Charts CSS**:
234+
```jsx
235+
// In your main App.js or index.js
236+
import '@patternfly/patternfly/patternfly-charts.css';
237+
```
238+
213239
## Quick Reference
214240
- **[PatternFly Charts README](https://github.com/patternfly/patternfly-react/tree/main/packages/react-charts#readme)** - Installation and usage
215241
- **[Victory.js Documentation](https://formidable.com/open-source/victory/)** - Chart library documentation
File renamed without changes.
File renamed without changes.

documentation/components/data-display/README.md renamed to .pf-ai-documentation/components/data-display/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,4 +212,11 @@ Key integration patterns from this example include:
212212
213213
> **Note:** Always consult the latest PatternFly Data View documentation and demo source code for the most up-to-date usage patterns and best practices.
214214
- [PatternFly React Data View GitHub](https://github.com/patternfly/react-data-view)
215-
- [PatternFly Data View NPM](https://www.npmjs.com/package/@patternfly/react-data-view)
215+
- [PatternFly Data View NPM](https://www.npmjs.com/package/@patternfly/react-data-view)
216+
217+
## Empty State Button Placement Rules
218+
219+
- ✅ **Place all buttons in an EmptyState inside the `EmptyStateFooter` component.**
220+
- ✅ **Group each row of buttons within an `EmptyStateActions` container inside the `EmptyStateFooter`.**
221+
- ✅ **Use a separate `EmptyStateActions` for each row of actions if multiple rows are needed.**
222+
- ❌ **Do not place buttons directly inside `EmptyState` or `EmptyStateBody`.**
File renamed without changes.
File renamed without changes.
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Core development rules for AI coders building PatternFly React applications.
2222
-**Compose components** - Build complex UIs by combining PatternFly components
2323
-**Don't override component internals** - Use provided props and APIs
2424

25+
### Tokenss
26+
-**ALWAYS use PatternFly tokens** - Use `pf-t-` prefixed classes over `pf-v6-` classes (e.g., `var(--pf-t--global--spacer--sm)` not `var(--pf-v6-global--spacer--sm)`)
27+
2528
### Text Components (v6+)
2629
```jsx
2730
// ✅ Correct
@@ -43,7 +46,7 @@ import { UserIcon } from '@patternfly/react-icons';
4346
### Styling Rules
4447

4548
-**Use PatternFly utilities** - Before writing custom CSS
46-
-**Use semantic design tokens** for custom CSS (e.g., `var(--pf-v6-global--primary-color--light)`), not base tokens with numbers (e.g., `--pf-v6-global--Color--100`) or hardcoded values
49+
-**Use semantic design tokens** for custom CSS (e.g., `var(--pf-t--global--text--color--regular)`), not base tokens with numbers (e.g., `--pf-t--global--text--color--100`) or hardcoded values
4750
-**Don't mix PatternFly versions** - Stick to v6 throughout
4851

4952
### Documentation Requirements
File renamed without changes.

0 commit comments

Comments
 (0)