Skip to content

refactor(ipa): Move index ownership to <Guidelines> via context#54

Merged
andmatei merged 2 commits into
mainfrom
andmatei/guideline-auto-numbering
Jun 10, 2026
Merged

refactor(ipa): Move index ownership to <Guidelines> via context#54
andmatei merged 2 commits into
mainfrom
andmatei/guideline-auto-numbering

Conversation

@andmatei

@andmatei andmatei commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Tickets: CLOUDP-406096

Screenshot 2026-06-10 at 15 46 05

<Guideline> now reads a boolean context set by <Guidelines> to decide whether to render the numbered circle and whether to use <li> vs <div> as its root element. The number badge only appears inside <Guidelines>; a standalone <Guideline> renders without it.

<Guideline> now reads a boolean context set by <Guidelines> to decide
whether to render the numbered circle and whether to use <li> vs <div>
as its root element. This keeps HTML semantics valid in both contexts
and ensures the number badge only appears inside an ordered list.

- GuidelinesContext.ts: boolean context + useIsInsideGuidelines hook
- Guideline: conditional li/div root, conditional .index div, .numbered
  class carries counter-increment so standalone use has no side-effects
- Guideline.test.tsx: new — asserts standalone renders as div without circle
- Guidelines.test.tsx: updated — asserts children render as li with circles
- component-fixtures.mdx: adds standalone <Guideline> fixture; fixes
  single-child section to have exactly one child
@andmatei andmatei force-pushed the andmatei/guideline-auto-numbering branch from bc09f53 to ebf1f2f Compare June 10, 2026 14:04
@wtrocki

wtrocki commented Jun 10, 2026

Copy link
Copy Markdown
Member

Can we attach screenshot containing changes?

@andmatei andmatei changed the title refactor(ipa): move index circle ownership to <Guidelines> via context refactor(ipa): Move index ownership to <Guidelines> via context Jun 10, 2026
@andmatei andmatei merged commit f960423 into main Jun 10, 2026
10 of 13 checks passed
@andmatei andmatei deleted the andmatei/guideline-auto-numbering branch June 10, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants