Skip to content

feat(ui): add footer to the code-block component#1832

Merged
vlad-schur-external-sap merged 4 commits into
mainfrom
vlad-codeblock-footer
Jul 24, 2026
Merged

feat(ui): add footer to the code-block component#1832
vlad-schur-external-sap merged 4 commits into
mainfrom
vlad-codeblock-footer

Conversation

@vlad-schur-external-sap

@vlad-schur-external-sap vlad-schur-external-sap commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Added CodeBlockFooter for the CodeBlock component with new prop allowing to override the default copy prop.

Changes Made

  • Extracted existing copy functionality into CodeBlockFooter component
  • Added codeBlockFooter props which replaces the default footer

Related Issues

Screenshots (if applicable)

Testing Instructions

  1. pnpm i
  2. pnpm TASK

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.
  • I have created a changeset for my changes.

PR Manifesto

Review the PR Manifesto for best practises.

Copilot AI review requested due to automatic review settings July 24, 2026 11:36
@changeset-bot

changeset-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b6d6cec

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

This PR includes changesets to release 9 packages
Name Type
@cloudoperators/juno-ui-components Minor
@cloudoperators/juno-app-carbon Patch
@cloudoperators/juno-app-doop Patch
@cloudoperators/juno-app-example Patch
@cloudoperators/juno-app-greenhouse Patch
@cloudoperators/juno-app-heureka Patch
@cloudoperators/juno-app-supernova Patch
@cloudoperators/juno-app-template Patch
@cloudoperators/juno-messages-provider 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

@vlad-schur-external-sap vlad-schur-external-sap linked an issue Jul 24, 2026 that may be closed by this pull request
3 tasks
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-24 13:38 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a reusable footer for the CodeBlock component in @cloudoperators/juno-ui-components, and introduces a new slot prop to allow consumers to fully override the default copy bar UI.

Changes:

  • Extracted the default copy bar into a new CodeBlockFooter component and exported it from the CodeBlock package entry.
  • Added codeBlockFooter?: ReactElement to CodeBlock to allow replacing the default footer (taking precedence over copy).
  • Added a Storybook example demonstrating a custom footer with Download + Copy actions, plus a changeset for a minor release.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/ui-components/src/components/CodeBlock/index.ts Exposes CodeBlockFooter via the CodeBlock barrel export.
packages/ui-components/src/components/CodeBlock/CodeBlockFooter.component.tsx Introduces the extracted footer component used by CodeBlock.
packages/ui-components/src/components/CodeBlock/CodeBlock.stories.tsx Adds a story demonstrating a fully custom footer override.
packages/ui-components/src/components/CodeBlock/CodeBlock.component.tsx Adds codeBlockFooter slot and wires it into the render path with precedence over copy.
.changeset/true-pears-judge.md Declares a minor version bump and documents the new footer/slot API.

Comment thread packages/ui-components/src/components/CodeBlock/CodeBlockFooter.component.tsx Outdated
Comment thread packages/ui-components/src/components/CodeBlock/CodeBlockFooter.component.tsx Outdated
Comment thread packages/ui-components/src/components/CodeBlock/CodeBlockFooter.component.tsx Outdated
@vlad-schur-external-sap vlad-schur-external-sap added the ui-components All tasks related to juno-ui-components library label Jul 24, 2026
Signed-off-by: Vladislav Schur <[email protected]>
Copilot AI review requested due to automatic review settings July 24, 2026 12:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread packages/ui-components/src/components/CodeBlock/index.ts
Signed-off-by: Vladislav Schur <[email protected]>
Copilot AI review requested due to automatic review settings July 24, 2026 12:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

@edda edda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@vlad-schur-external-sap
vlad-schur-external-sap merged commit cf79a1f into main Jul 24, 2026
25 checks passed
@vlad-schur-external-sap
vlad-schur-external-sap deleted the vlad-codeblock-footer branch July 24, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui-components All tasks related to juno-ui-components library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task](ui): implement custom CodeBlock footer and options

5 participants