Skip to content

feat(lightspeed): migrated plugin to nfs#2721

Merged
rohitkrai03 merged 1 commit intoredhat-developer:mainfrom
debsmita1:lightspeed-nfs
Apr 14, 2026
Merged

feat(lightspeed): migrated plugin to nfs#2721
rohitkrai03 merged 1 commit intoredhat-developer:mainfrom
debsmita1:lightspeed-nfs

Conversation

@debsmita1
Copy link
Copy Markdown
Member

@debsmita1 debsmita1 commented Apr 8, 2026

Hey, I just made a Pull Request!

Resolves:
https://redhat.atlassian.net/browse/RHIDP-11860

Screen.Recording.2026-04-08.at.1.27.22.PM.mov

✔️ 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)

@rhdh-gh-app
Copy link
Copy Markdown

rhdh-gh-app bot commented Apr 8, 2026

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
app-legacy workspaces/lightspeed/packages/app-legacy none v0.0.1
app workspaces/lightspeed/packages/app none v0.0.0
@red-hat-developer-hub/backstage-plugin-lightspeed workspaces/lightspeed/plugins/lightspeed minor v1.4.0

@rhdh-qodo-merge
Copy link
Copy Markdown

Review Summary by Qodo

Migrate Lightspeed plugin to new frontend system (NFS)

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Migrated Lightspeed plugin to new frontend system (NFS)
• Extracted provider state logic into dedicated hook
• Added FAB module and app drawer integration
• Updated dependencies and test infrastructure
Diagram
flowchart LR
  A["LightspeedDrawerProvider"] -->|uses| B["useLightspeedProviderState"]
  B -->|manages| C["State & Routing"]
  B -->|syncs with| D["AppDrawer"]
  E["LightspeedFAB"] -->|uses| F["useLightspeedDrawerContext"]
  G["alpha/index.tsx"] -->|exports| H["Frontend Modules"]
  H -->|includes| I["lightspeedFABModule"]
  H -->|includes| J["lightspeedTranslationsModule"]
Loading

Grey Divider

File Changes

1. workspaces/lightspeed/plugins/lightspeed/src/const.ts ✨ Enhancement +2/-0

Added Lightspeed app drawer ID constant

workspaces/lightspeed/plugins/lightspeed/src/const.ts


2. workspaces/lightspeed/plugins/lightspeed/src/hooks/useLightspeedProviderState.ts ✨ Enhancement +272/-0

New hook encapsulating provider state and routing logic

workspaces/lightspeed/plugins/lightspeed/src/hooks/useLightspeedProviderState.ts


3. workspaces/lightspeed/.changeset/new-seas-melt.md 📝 Documentation +5/-0

Changeset documenting NFS migration

workspaces/lightspeed/.changeset/new-seas-melt.md


View more (12)
4. workspaces/lightspeed/package.json Dependencies +1/-0

Updated testing library resolution

workspaces/lightspeed/package.json


5. workspaces/lightspeed/packages/app-legacy/package.json Dependencies +1/-1

Upgraded testing library React to 15.0.0

workspaces/lightspeed/packages/app-legacy/package.json


6. workspaces/lightspeed/packages/app/package.json Dependencies +3/-1

Added app-react and lightspeed plugin dependencies

workspaces/lightspeed/packages/app/package.json


7. workspaces/lightspeed/packages/app/src/App.tsx ✨ Enhancement +14/-1

Integrated app drawer and lightspeed modules

workspaces/lightspeed/packages/app/src/App.tsx


8. workspaces/lightspeed/plugins/lightspeed/package.json Dependencies +4/-3

Updated alpha export path and added app-react dependency

workspaces/lightspeed/plugins/lightspeed/package.json


9. workspaces/lightspeed/plugins/lightspeed/report-alpha.api.md 📝 Documentation +164/-0

Updated API report with new frontend system exports

workspaces/lightspeed/plugins/lightspeed/report-alpha.api.md


10. workspaces/lightspeed/plugins/lightspeed/src/alpha/LightspeedFAB.tsx ✨ Enhancement +91/-0

New FAB component for opening/closing chatbot

workspaces/lightspeed/plugins/lightspeed/src/alpha/LightspeedFAB.tsx


11. workspaces/lightspeed/plugins/lightspeed/src/alpha/LightspeedProvider.tsx ✨ Enhancement +8/-1

Refactored to export LightspeedDrawerProvider

workspaces/lightspeed/plugins/lightspeed/src/alpha/LightspeedProvider.tsx


12. workspaces/lightspeed/plugins/lightspeed/src/alpha/index.tsx ✨ Enhancement +158/-0

New NFS plugin entry point with modules and blueprints

workspaces/lightspeed/plugins/lightspeed/src/alpha/index.tsx


13. workspaces/lightspeed/plugins/lightspeed/src/components/LightspeedDrawerProvider.tsx ✨ Enhancement +6/-202

Refactored to use useLightspeedProviderState hook

workspaces/lightspeed/plugins/lightspeed/src/components/LightspeedDrawerProvider.tsx


14. workspaces/lightspeed/plugins/lightspeed/src/components/__tests__/LightspeedDrawerProvider.test.tsx 🧪 Tests +133/-221

Simplified tests to mock hook instead of internal logic

workspaces/lightspeed/plugins/lightspeed/src/components/tests/LightspeedDrawerProvider.test.tsx


15. workspaces/lightspeed/plugins/lightspeed/src/hooks/__tests__/useLightspeedProviderState.test.tsx 🧪 Tests +285/-0

New comprehensive tests for provider state hook

workspaces/lightspeed/plugins/lightspeed/src/hooks/tests/useLightspeedProviderState.test.tsx


Grey Divider

Qodo Logo

@rhdh-qodo-merge
Copy link
Copy Markdown

rhdh-qodo-merge bot commented Apr 8, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX Issues (0)

Grey Divider


Action required

1. Provider export missing 🐞 Bug ≡ Correctness
Description
LightspeedProvider is documented as exported from the alpha entrypoint but src/alpha/index.tsx
never re-exports it, so consumers importing it from @.../backstage-plugin-lightspeed/alpha will
fail at build time.
The generated report-alpha.api.md confirms LightspeedProvider is not part of the alpha API
surface.
Code

workspaces/lightspeed/plugins/lightspeed/src/alpha/index.tsx[R149-158]

+export default createFrontendPlugin({
+  pluginId: 'lightspeed',
+  extensions: [lightspeedApi, notebooksApi, lightspeedPage, lightspeedDrawer],
+  routes: {
+    root: nfsRootRouteRef,
+    lightspeedConversation: nfsConversationRouteRef,
+  },
+});
+
+export * from '../translations';
Evidence
LightspeedProvider.tsx explicitly states it is exported from the alpha entry point, but the alpha
entrypoint only exports the default plugin, the two modules, and ../translations. API Extractor
output also contains no LightspeedProvider symbol, confirming the missing export.

workspaces/lightspeed/plugins/lightspeed/src/alpha/LightspeedProvider.tsx[17-24]
workspaces/lightspeed/plugins/lightspeed/src/alpha/index.tsx[149-158]
workspaces/lightspeed/plugins/lightspeed/report-alpha.api.md[165-169]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`LightspeedProvider` is implemented and documented as being exported from the alpha entry point, but it is not re-exported from `src/alpha/index.tsx`. This makes it unavailable to consumers of `@red-hat-developer-hub/backstage-plugin-lightspeed/alpha`.

## Issue Context
- `src/alpha/LightspeedProvider.tsx` contains a public alpha export.
- `src/alpha/index.tsx` is the package export target for `./alpha` but does not re-export `LightspeedProvider`.
- `report-alpha.api.md` has no `LightspeedProvider`, confirming it’s missing from the public surface.

## Fix Focus Areas
- workspaces/lightspeed/plugins/lightspeed/src/alpha/index.tsx[149-158]
- workspaces/lightspeed/plugins/lightspeed/src/alpha/LightspeedProvider.tsx[17-24]

## Suggested change
Add a named export in `src/alpha/index.tsx`, e.g.:
- `export { LightspeedProvider } from './LightspeedProvider';`

Then re-run API Extractor / update `report-alpha.api.md` accordingly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. FAB aria-label inverted 🐞 Bug ≡ Correctness
Description
LightspeedFAB sets aria-label to "lightspeed-open" when the chatbot is active and
"lightspeed-close" when it is inactive, contradicting the tooltip/icon and announcing the wrong
action/state to assistive technologies.
This is an accessibility/correctness bug in the new alpha FAB.
Code

workspaces/lightspeed/plugins/lightspeed/src/alpha/LightspeedFAB.tsx[R73-87]

+      <Tooltip
+        title={isChatbotActive ? 'Close Lightspeed' : 'Open Lightspeed'}
+        placement="left"
+      >
+        <Fab
+          color="primary"
+          variant="circular"
+          size="small"
+          onClick={toggleChatbot}
+          aria-label={isChatbotActive ? 'lightspeed-open' : 'lightspeed-close'}
+          className={fabButton.fab}
+          sx={{ borderRadius: '100% !important' }}
+        >
+          {isChatbotActive ? <Close fontSize="small" /> : <LightspeedFABIcon />}
+        </Fab>
Evidence
In the same render block, the tooltip text and the icon reflect the opposite action (close when
active, open when inactive), while the aria-label string is reversed.

workspaces/lightspeed/plugins/lightspeed/src/alpha/LightspeedFAB.tsx[73-87]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The alpha `LightspeedFAB` uses an inverted `aria-label` ternary expression. When the chatbot is active, it announces `lightspeed-open`, and when inactive it announces `lightspeed-close`, which is the opposite of the UI.

## Issue Context
Tooltip + icon already indicate the correct action/state:
- Active: "Close Lightspeed" + Close icon
- Inactive: "Open Lightspeed" + Lightspeed icon

## Fix Focus Areas
- workspaces/lightspeed/plugins/lightspeed/src/alpha/LightspeedFAB.tsx[73-87]

## Suggested change
Swap the values:
```ts
aria-label={isChatbotActive ? 'lightspeed-close' : 'lightspeed-open'}
```
(Or use more descriptive labels like "Open Lightspeed chatbot" / "Close Lightspeed chatbot".)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines +149 to +158
export default createFrontendPlugin({
pluginId: 'lightspeed',
extensions: [lightspeedApi, notebooksApi, lightspeedPage, lightspeedDrawer],
routes: {
root: nfsRootRouteRef,
lightspeedConversation: nfsConversationRouteRef,
},
});

export * from '../translations';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Provider export missing 🐞 Bug ≡ Correctness

LightspeedProvider is documented as exported from the alpha entrypoint but src/alpha/index.tsx
never re-exports it, so consumers importing it from @.../backstage-plugin-lightspeed/alpha will
fail at build time.
The generated report-alpha.api.md confirms LightspeedProvider is not part of the alpha API
surface.
Agent Prompt
## Issue description
`LightspeedProvider` is implemented and documented as being exported from the alpha entry point, but it is not re-exported from `src/alpha/index.tsx`. This makes it unavailable to consumers of `@red-hat-developer-hub/backstage-plugin-lightspeed/alpha`.

## Issue Context
- `src/alpha/LightspeedProvider.tsx` contains a public alpha export.
- `src/alpha/index.tsx` is the package export target for `./alpha` but does not re-export `LightspeedProvider`.
- `report-alpha.api.md` has no `LightspeedProvider`, confirming it’s missing from the public surface.

## Fix Focus Areas
- workspaces/lightspeed/plugins/lightspeed/src/alpha/index.tsx[149-158]
- workspaces/lightspeed/plugins/lightspeed/src/alpha/LightspeedProvider.tsx[17-24]

## Suggested change
Add a named export in `src/alpha/index.tsx`, e.g.:
- `export { LightspeedProvider } from './LightspeedProvider';`

Then re-run API Extractor / update `report-alpha.api.md` accordingly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@debsmita1 debsmita1 force-pushed the lightspeed-nfs branch 3 times, most recently from 86aba32 to 2def751 Compare April 8, 2026 12:25
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
6.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

HusneShabbir

This comment was marked as duplicate.

@HusneShabbir
Copy link
Copy Markdown
Contributor

HusneShabbir commented Apr 10, 2026

/lgtm

Both NFS & legacy apps are functioning as expected.

Copy link
Copy Markdown
Contributor

@rohitkrai03 rohitkrai03 left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@rohitkrai03 rohitkrai03 merged commit 6ae51d4 into redhat-developer:main Apr 14, 2026
10 of 11 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.

3 participants