Skip to content

Conversation

@ciiay
Copy link
Member

@ciiay ciiay commented Oct 29, 2025

Hey, I just made a Pull Request!

For RHDHBUGS-2075

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

Steps to test changes on RHDH

  1. Pull changes from this PR to your local rhdh-plugins path
  2. Update theme package version in your local rhdh/packages/app/package.json:
    "@red-hat-developer-hub/backstage-plugin-theme": "portal:<path_to_your>/rhdh-plugins/workspaces/theme/plugins/theme",
  1. Run yarn install in your local RHDH root
  2. Start rhdh by yarn dev

Steps to register a demo subHeader addon on techdocs

  1. Add this to your <your_local>/rhdh/dynamic-plugins/wrappers/backstage-plugin-techdocs-module-addons-contrib/src/addons.tsx
const SubheaderDemoImpl = () => {
  return (
    <div
      style={{
        display: 'flex',
        gap: 8,
        alignItems: 'center',
        padding: '6px 8px',
      }}
    >
      <button
        type="button"
        onClick={() =>
          console.log('Subheader addon clicked')
        }
        style={{
          cursor: 'pointer',
          border: '1px solid var(--backstage-divider, #e0e0e0)',
          borderRadius: 6,
          padding: '6px 10px',
          background: 'var(--backstage-background, #fff)',
          fontSize: 13,
        }}
      >
        Subheader Demo
      </button>
    </div>
  );
};

export const SubheaderDemo = techdocsModuleAddonsContribPlugin.provide(
  createTechDocsAddonExtension<{}>({
    name: 'SubheaderDemo',
    location: TechDocsAddonLocations.Subheader, // 👈 the important bit
    component: SubheaderDemoImpl,
  }),
);
  1. Add this to your <your_local>/rhdh/dynamic-plugins/wrappers/backstage-plugin-techdocs-module-addons-contrib/src/index.tx to export the addedSubheaderDemo
export { ReportIssue, SubheaderDemo } from "./addons";
  1. Add this to your app-config.local.yaml to register the SubheaderDemo
dynamicPlugins:
  rootDirectory: dynamic-plugins-root
  frontend:
    backstage.plugin-techdocs:
    ... # default techdocs configuration
    backstage.plugin-techdocs-module-addons-contrib:
      techdocsAddons:
        - importName: SubheaderDemo
image image

@ciiay ciiay requested review from a team and logonoff as code owners October 29, 2025 23:04
@ciiay ciiay requested review from sanketpathak and teknaS47 and removed request for a team October 29, 2025 23:04
@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Oct 29, 2025

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-theme workspaces/theme/plugins/theme patch v0.10.1

@sonarqubecloud
Copy link

Copy link
Contributor

@lokanandaprabhu lokanandaprabhu left a comment

Choose a reason for hiding this comment

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

Tested locally, working fine.

/lgtm

-----BEFORE----

Screenshot 2025-11-04 at 12 04 11 PM Screenshot 2025-11-04 at 12 04 26 PM

-----AFTER----

Screenshot 2025-11-04 at 12 04 39 PM Screenshot 2025-11-04 at 12 04 53 PM

@openshift-ci openshift-ci bot added the lgtm label Nov 4, 2025
@ciiay ciiay merged commit 374d565 into redhat-developer:main Nov 5, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants