Skip to content

Commit 3fcf847

Browse files
docs: add testing and implementation documentation
1 parent 01a0713 commit 3fcf847

File tree

11 files changed

+1059
-250
lines changed

11 files changed

+1059
-250
lines changed

COMMIT_MESSAGE.md

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
# Commit Message for Marker Type Feature
2+
3+
## Exact Commit Message
4+
5+
```
6+
feat(unordered-list): add support for marker types
7+
8+
Add support for different list marker types (disc, circle, square,
9+
hyphen, custom) to the UnorderedList component in both React and
10+
Web Components packages.
11+
12+
This change allows users to customize list markers beyond the default
13+
hyphen (top-level) and square (nested) styles. The implementation uses
14+
native CSS list-style-type for disc/circle/square markers and custom
15+
::before pseudo-elements for hyphen and custom markers.
16+
17+
Features:
18+
- New `type` prop accepting: 'disc' | 'circle' | 'square' | 'hyphen' |
19+
'custom'
20+
- New `customMarker` prop for custom marker content (requires
21+
type="custom")
22+
- Default behavior: hyphen for top-level, square for nested (with
23+
deprecation warning)
24+
- Backward compatible with existing lists
25+
26+
React Component:
27+
- Added type and customMarker props to UnorderedListProps interface
28+
- Deprecation warning for nested lists without explicit type prop
29+
- CSS class application based on marker type
30+
31+
Web Components:
32+
- Added type and customMarker properties with attribute reflection
33+
- Parent inheritance for nested lists (inherits parent's type when
34+
not specified)
35+
- Same deprecation warning pattern as React
36+
37+
SCSS Changes:
38+
- Added marker type classes: .cds--list--marker-{type}
39+
- Native list-style-type support for disc/circle/square
40+
- Custom marker support via CSS custom property
41+
- Nested list handling for all marker types
42+
43+
Examples:
44+
- type="disc": renders • bullets
45+
- type="circle": renders ○ bullets
46+
- type="square": renders ▪ bullets
47+
- type="hyphen": renders – bullets (default)
48+
- type="custom" with customMarker="→": renders → bullets
49+
50+
Closes #16937
51+
```
52+
53+
---
54+
55+
## Verification
56+
57+
### Header Check
58+
59+
```
60+
feat(unordered-list): add support for marker types
61+
```
62+
63+
- Length: **54 characters** ✅ (< 72 required)
64+
- Type: `feat`
65+
- Scope: `unordered-list`
66+
- Subject: imperative, present tense ✅
67+
- No period at end ✅
68+
- Lowercase first letter ✅
69+
70+
### Body Check
71+
72+
- All lines < 80 characters ✅
73+
- Imperative, present tense ✅
74+
- Explains motivation ✅
75+
- Contrasts with previous behavior ✅
76+
- Includes examples ✅
77+
78+
### Footer Check
79+
80+
- References issue #16937
81+
- Uses "Closes" keyword ✅
82+
83+
---
84+
85+
## Commit Command Options
86+
87+
### Option 1: Using Git Editor (Recommended)
88+
89+
```bash
90+
# Stage your changes
91+
git add .
92+
93+
# Open editor for commit message
94+
git commit
95+
```
96+
97+
Then paste the full commit message above into the editor.
98+
99+
### Option 2: Using Commit Message File
100+
101+
```bash
102+
# Create commit message file
103+
cat > /tmp/commit-msg.txt << 'EOF'
104+
feat(unordered-list): add support for marker types
105+
106+
Add support for different list marker types (disc, circle, square,
107+
hyphen, custom) to the UnorderedList component in both React and
108+
Web Components packages.
109+
110+
This change allows users to customize list markers beyond the default
111+
hyphen (top-level) and square (nested) styles. The implementation uses
112+
native CSS list-style-type for disc/circle/square markers and custom
113+
::before pseudo-elements for hyphen and custom markers.
114+
115+
Features:
116+
- New `type` prop accepting: 'disc' | 'circle' | 'square' | 'hyphen' |
117+
'custom'
118+
- New `customMarker` prop for custom marker content (requires
119+
type="custom")
120+
- Default behavior: hyphen for top-level, square for nested (with
121+
deprecation warning)
122+
- Backward compatible with existing lists
123+
124+
React Component:
125+
- Added type and customMarker props to UnorderedListProps interface
126+
- Deprecation warning for nested lists without explicit type prop
127+
- CSS class application based on marker type
128+
129+
Web Components:
130+
- Added type and customMarker properties with attribute reflection
131+
- Parent inheritance for nested lists (inherits parent's type when
132+
not specified)
133+
- Same deprecation warning pattern as React
134+
135+
SCSS Changes:
136+
- Added marker type classes: .cds--list--marker-{type}
137+
- Native list-style-type support for disc/circle/square
138+
- Custom marker support via CSS custom property
139+
- Nested list handling for all marker types
140+
141+
Examples:
142+
- type="disc": renders • bullets
143+
- type="circle": renders ○ bullets
144+
- type="square": renders ▪ bullets
145+
- type="hyphen": renders – bullets (default)
146+
- type="custom" with customMarker="→": renders → bullets
147+
148+
Closes #16937
149+
EOF
150+
151+
# Commit using the file
152+
git commit -F /tmp/commit-msg.txt
153+
```
154+
155+
### Option 3: Inline Multi-line (Not Recommended)
156+
157+
For very long messages, use the editor or file method above.
158+
159+
---
160+
161+
## Explanation of Each Part
162+
163+
### Header: `feat(unordered-list): add support for marker types`
164+
165+
- **`feat`**: Type indicating a new feature
166+
- **`(unordered-list)`**: Scope specifying the component affected
167+
- **`add support for marker types`**: Subject describing what was added
168+
- Imperative mood: "add" not "added" or "adds"
169+
- No period at end
170+
- Lowercase first letter
171+
- Under 72 characters
172+
173+
### Body: Explains What, Why, and How
174+
175+
**First paragraph:**
176+
177+
- What was added (marker types)
178+
- Which components (React and Web Components)
179+
180+
**Second paragraph:**
181+
182+
- Why it matters (customization beyond defaults)
183+
- How it's implemented (CSS approach)
184+
185+
**Features section:**
186+
187+
- Lists all new props and their types
188+
- Mentions default behavior and deprecation
189+
190+
**Component sections:**
191+
192+
- React-specific changes
193+
- Web Components-specific changes
194+
- SCSS changes
195+
196+
**Examples section:**
197+
198+
- Shows how each marker type renders
199+
- Helps reviewers understand the feature
200+
201+
### Footer: `Closes #16937`
202+
203+
- References the GitHub issue
204+
- Uses "Closes" keyword to auto-close the issue when merged
205+
206+
---
207+
208+
## Pre-Commit Checklist
209+
210+
Before committing, verify:
211+
212+
- [ ] All files are staged (`git status` shows no unstaged changes)
213+
- [ ] No build errors
214+
- [ ] Tests pass (if applicable)
215+
- [ ] Commit message follows all conventions
216+
- [ ] Header is < 72 characters
217+
- [ ] Body lines are < 80 characters
218+
- [ ] Issue number is correct (#16937)
219+
220+
---
221+
222+
## After Committing
223+
224+
Once you've committed, you can verify the commit message:
225+
226+
```bash
227+
# View last commit message
228+
git log -1 --pretty=format:"%s%n%n%b"
229+
230+
# Verify commitlint passes
231+
npx commitlint --from HEAD~1 --to HEAD --verbose
232+
```
233+
234+
---
235+
236+
## Ready to Commit!
237+
238+
Use the commit message above. It follows all Carbon conventions: ✅ Header < 72
239+
characters ✅ Body lines < 80 characters
240+
✅ Imperative, present tense ✅ No period at end of subject ✅ Includes
241+
motivation ✅ References issue #16937 ✅ Includes examples

0 commit comments

Comments
 (0)