Skip to content

[CodeBlock] Fix token rendering and sub-pixel border #606

@ravisuhag

Description

@ravisuhag

Summary

Minor improvements to the CodeBlock component.

Improvements

2. Array index as key in token rendering

Both line and token maps use array index as key. For stable rendering, this is acceptable for static content but could cause issues with dynamic content updates.

3. maxLines off-by-one compensation

The context adds +1 to maxLines ("to compensate for the absolute collapse trigger"). This leaks implementation detail into the API — consumers pass maxLines={5} but 6 lines are stored internally.

4. Sub-pixel border value

Uses border: 0.5px solid in header and collapse trigger styles.

Moved to Cross-Cutting Issues

The following items have been moved to cross-cutting issues that address them across all components:

Metadata

Metadata

Assignees

No one assigned

    Labels

    componentIndividual component-level issuetriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions