Skip to content

fix(core): render semantic headings for application and content headers - #2703

Open
lakshmi-priya-b wants to merge 4 commits into
mainfrom
fix/core-semantic-header-headings
Open

fix(core): render semantic headings for application and content headers#2703
lakshmi-priya-b wants to merge 4 commits into
mainfrom
fix/core-semantic-header-headings

Conversation

@lakshmi-priya-b

@lakshmi-priya-b lakshmi-priya-b commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

💡 What is the current behavior?

ix-application-header and ix-content-header render their titles through ix-typography, so the headings are not native HTML heading elements. The visual style depends on the typography format prop, and the DOM does not expose semantic h1/h2 structure.

JIRA : IX-4327

🆕 What is the new behavior?

ix-application-header now renders its title as a native h1, and ix-content-header renders its title as a native h2. The visual typography stays the same through SCSS mixins, and the variant-specific styling is preserved with classes instead of heading-format props.

🏁 Checklist

A pull request can only be merged if all of these conditions are met (where applicable):

  • 🦮 Accessibility (a11y) features were implemented
  • 🗺️ Internationalization (i18n) - no hard coded strings
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully
  • 📕 Add or update a Storybook story
  • 📄 Documentation was reviewed/updated siemens/ix-docs
  • 🧪 Unit tests were added/updated and pass (pnpm test)
  • 📸 Visual regression tests were added/updated and pass (Guide)
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

Summary by CodeRabbit

  • Accessibility Improvements
    • Application names now render as semantic <h1> headings.
    • Content header titles now render as semantic <h2> headings, improving document structure and assistive technology support.
  • Style
    • Refined application and content header typography, spacing, and secondary-title presentation.
  • Tests
    • Added coverage for heading semantics, visibility, hydration, accessibility, and primary and secondary header variants.

@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 947f8b8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@siemens/ix Patch
@siemens/ix-angular Patch
@siemens/ix-docs Patch
@siemens/ix-react Patch
@siemens/ix-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify

netlify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploy Preview for ix-storybook ready!

Name Link
🔨 Latest commit 947f8b8
🔍 Latest deploy log https://app.netlify.com/projects/ix-storybook/deploys/6a8713941f57310008eafae4
😎 Deploy Preview https://deploy-preview-2703--ix-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 27ff2e19-c38e-4e96-a94b-6b9df1e4ea83

📥 Commits

Reviewing files that changed from the base of the PR and between 47c25cb and 947f8b8.

📒 Files selected for processing (2)
  • .changeset/semantic-header-headings.md
  • packages/core/src/components/application-header/application-header.scss

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Application and content headers now use native h1 and h2 elements. Typography styles preserve the intended visual variants. Component tests cover accessibility, rendering, hydration, visibility, and variant classes.

Changes

Header semantics and typography

Layer / File(s) Summary
Application header heading
packages/core/src/components/application-header/application-header.scss, packages/core/src/components/application-header/application-header.tsx, packages/core/src/components/application-header/test/application-header.ct.ts
The application name now renders as h1.application-name with body-large typography and reset spacing. Tests cover accessibility and heading presence.
Content header heading
packages/core/src/components/content-header/content-header.scss, packages/core/src/components/content-header/content-header.tsx, packages/core/src/components/content-header/test/content-header.ct.ts
The content title now renders as h2.header-title. Primary and secondary typography styles remain defined in SCSS. Tests cover accessibility, hydration, visibility, title text, variant classes, and heading omission.
Release metadata
.changeset/semantic-header-headings.md
A patch changeset documents semantic heading rendering for both header components.

Estimated code review effort: 2 (Simple) | ~15 minutes

Merge Risk: ⚪ Minimal · up to 947f8

This PR changes application and content headers to use semantic HTML headings while preserving their visual styling. No actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: lzeiml

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: semantic heading rendering for both application and content headers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/core-semantic-header-headings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lakshmi-priya-b
lakshmi-priya-b marked this pull request as ready for review August 11, 2026 10:43
@lakshmi-priya-b
lakshmi-priya-b requested a review from a team as a code owner August 11, 2026 10:43
@lakshmi-priya-b
lakshmi-priya-b requested a review from lzeiml August 11, 2026 10:43

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/core/src/components/application-header/application-header.scss`:
- Around line 106-108: Add the required empty line after the typography mixin
and before margin in
packages/core/src/components/application-header/application-header.scss (lines
106-108). In packages/core/src/components/content-header/content-header.scss
(lines 31-40), add empty lines before margin and the secondary padding
declaration to satisfy Stylelint.

In `@packages/core/src/components/application-header/application-header.tsx`:
- Line 409: Conditionally render the h1.application-name in the
application-header component only when this.name has content, and conditionally
render the h2.header-title in content-header only when this.headerTitle has
content; update regression coverage for omitted titles, preserving accessible
heading behavior for provided titles. Affected sites:
packages/core/src/components/application-header/application-header.tsx lines
409-409 requires the conditional h1 change;
packages/core/src/components/content-header/content-header.tsx lines 63-71
requires the conditional h2 change.
- Line 409: Add a package-scoped changeset describing the consumer-facing
heading-semantic and accessibility changes for ix-application-header at
packages/core/src/components/application-header/application-header.tsx:409-409
and ix-content-header at
packages/core/src/components/content-header/content-header.tsx:63-71; do not
classify the change as internal-only unless that justification is explicitly
valid.

In
`@packages/core/src/components/application-header/test/application-header.ct.ts`:
- Around line 14-33: Replace the plain test calls in the accessibility and
application-name heading tests with regressionTest, and import regressionTest
from `@utils/test`. Preserve the existing test bodies and assertions.
- Around line 23-32: Update the heading assertions in
packages/core/src/components/application-header/test/application-header.ct.ts
(lines 23-32) and
packages/core/src/components/content-header/test/content-header.ct.ts (lines
48-55) to use accessibility locators: getByRole('heading', { level: 1, name:
'Test Application' }) and getByRole('heading', { level: 2, name: 'My Content
Page' }). Retain the secondary variant’s existing class assertion.

In `@packages/core/src/components/content-header/content-header.scss`:
- Around line 36-39: In the .secondary rule of the content-header styles, import
misc/common-variables under the vars namespace and replace the hardcoded 0.25rem
padding value with vars.$tiny-space, preserving the existing vertical padding
behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 39ed5d6b-35f5-4166-bdd2-9138a8341b69

📥 Commits

Reviewing files that changed from the base of the PR and between 5c43ed5 and bdac55e.

📒 Files selected for processing (6)
  • packages/core/src/components/application-header/application-header.scss
  • packages/core/src/components/application-header/application-header.tsx
  • packages/core/src/components/application-header/test/application-header.ct.ts
  • packages/core/src/components/content-header/content-header.scss
  • packages/core/src/components/content-header/content-header.tsx
  • packages/core/src/components/content-header/test/content-header.ct.ts

Comment thread packages/core/src/components/application-header/application-header.tsx Outdated
Comment thread packages/core/src/components/application-header/test/application-header.ct.ts Outdated
Comment thread packages/core/src/components/content-header/content-header.scss

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/core/src/components/content-header/test/content-header.ct.ts (1)

31-58: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the primary variant’s class state.

The test data sets hasSecondaryClass: false, but the assertion runs only for true. A regression that adds secondary to the primary heading still passes. Assert that the primary heading does not have the secondary class.

Proposed fix
-      if (hasSecondaryClass) {
-        await expect(
-          page.locator('ix-content-header').locator('h2.header-title')
-        ).toHaveClass(/\bsecondary\b/);
-      }
+      if (hasSecondaryClass) {
+        await expect(heading).toHaveClass(/\bsecondary\b/);
+      } else {
+        await expect(heading).not.toHaveClass(/\bsecondary\b/);
+      }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core/src/components/content-header/test/content-header.ct.ts` around
lines 31 - 58, Update the variant loop’s class assertion around
hasSecondaryClass so both states are validated: retain the existing
secondary-class assertion for the secondary variant and assert that the primary
variant’s h2.header-title does not have the secondary class when
hasSecondaryClass is false.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/core/src/components/content-header/content-header.tsx`:
- Around line 63-73: Add the title attribute to the h2 rendered in the
ContentHeader component, binding it to this.headerTitle so truncated titles
retain the existing full-title browser tooltip. Keep the current titleOverflow
class and other rendering behavior unchanged.

---

Outside diff comments:
In `@packages/core/src/components/content-header/test/content-header.ct.ts`:
- Around line 31-58: Update the variant loop’s class assertion around
hasSecondaryClass so both states are validated: retain the existing
secondary-class assertion for the secondary variant and assert that the primary
variant’s h2.header-title does not have the secondary class when
hasSecondaryClass is false.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1d617ce5-e81e-4c5e-bbd9-cacf6da4a6ab

📥 Commits

Reviewing files that changed from the base of the PR and between bdac55e and cc4a942.

📒 Files selected for processing (6)
  • packages/core/src/components/application-header/application-header.scss
  • packages/core/src/components/application-header/application-header.tsx
  • packages/core/src/components/application-header/test/application-header.ct.ts
  • packages/core/src/components/content-header/content-header.scss
  • packages/core/src/components/content-header/content-header.tsx
  • packages/core/src/components/content-header/test/content-header.ct.ts

Comment thread packages/core/src/components/content-header/content-header.tsx
@sonarqubecloud

Copy link
Copy Markdown

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