* fix: badge navigation uses window.location + correct settings plugin name
- AppBarScoreBadge: Read cluster from window.location.pathname instead of
useCluster() (returns null in AppBar context) or useLocation() (may not
reflect cluster prefix outside cluster route context)
- registerPluginSettings: Use 'polaris' to match the deployed directory name
(plugin is at static-plugins/polaris, not headlamp-polaris)
- Add unit test for no-cluster fallback navigation
Supersedes the source-code fixes from PR #55 without the workflow/deploy
script changes that broke CI.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
* fix: use Object.defineProperty for window.location in test
Replace `as Location` cast with Object.defineProperty to match the
existing beforeEach pattern and fix TypeScript strict mode error.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
---------
Co-authored-by: Gandalf the Greybeard <gandalf@privilegedescalation.dev>
Co-authored-by: Paperclip <noreply@paperclip.ing>
Two root causes for the remaining 6 E2E failures after PR #50:
1. AppBarScoreBadge: Router.createRouteURL('polaris') was called without
the cluster parameter, producing '/polaris' instead of '/c/main/polaris'.
Now uses K8s.useCluster() to pass the active cluster. (appbar.spec.ts:18)
2. Plugin settings: registerPluginSettings was called with 'polaris' but
the package.json name is 'headlamp-polaris'. Headlamp matches settings
registrations to the package name, so the component never rendered.
(settings.spec.ts — all 5 tests)
Co-authored-by: gandalf-the-greybeard[bot] <gandalf-the-greybeard[bot]@users.noreply.github.com>
Co-authored-by: Paperclip <noreply@paperclip.ing>
Fix badge navigation to use cluster-scoped path via Router.createRouteURL
instead of hardcoded '/polaris'. Remove hardcoded RGB color assertions in
badge color test. Scope ambiguous /%/ and 'Resources' selectors in polaris
E2E tests. Fix settings tests to click into plugin settings before asserting.
Fixes: PRI-151
Co-authored-by: gandalf-the-greybeard[bot] <gandalf-the-greybeard[bot]@users.noreply.github.com>
Co-authored-by: Paperclip <noreply@paperclip.ing>
* fix: restore badge emoji, fix aria-label, and correct service proxy URL
Three root causes for E2E test failures since March 4:
1. Service proxy URL missing http: protocol prefix — Kubernetes requires
the format http:service-name:port, not service-name:port. This caused
all data fetches to fail, making data-dependent components render
empty states instead of expected content.
2. AppBarScoreBadge aria-label "Polaris cluster score: X%" doesn't match
the E2E test regex /Polaris: \d+%/. Simplified to "Polaris: X%".
3. Shield emoji was removed from badge in commit 514de78 but E2E tests
still assert its presence.
Fixes PRI-20
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* style: format polaris.ts to pass prettier check
The service proxy URL fix in 61bf1fe exceeded the line length limit.
Run prettier to split the long line.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: gandalf-the-greybeard[bot] <gandalf-the-greybeard[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Run eslint autofix to sort imports and remove unused ResultCounts import
from InlineAuditSection. This fixes CI lint failures.
Changes:
- Sort imports in all source files per eslint-plugin-import rules
- Remove unused ResultCounts import from InlineAuditSection.tsx
All CI checks now pass:
- ✅ Build successful
- ✅ Lint clean (no warnings)
- ✅ Type-check passing
- ✅ Format check passing
- ✅ Unit tests passing (50/50)
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Replace all @mui/material and @mui/icons-material imports with standard
HTML elements and inline styles. This fixes the browser error:
"TypeError: undefined is not an object (evaluating 'q.createSvgIcon')"
The Headlamp plugin environment doesn't provide the full MUI library,
so plugins must use only Headlamp CommonComponents or standard HTML.
Changes:
- AppBarScoreBadge: Replace Chip and ShieldIcon with button and emoji
- DashboardView: Replace Button and RefreshIcon with button and emoji
- ExemptionManager: Replace all MUI form components with HTML equivalents
- PolarisSettings: Replace Button with HTML button
All tests passing (50/50), TypeScript compilation clean, build successful.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Major new features:
- App bar score badge showing cluster Polaris score
- Inline audit results in Deployment/StatefulSet/DaemonSet/Job/CronJob detail views
- Exemption management UI with annotation PATCH support
- Top issues table on overview dashboard
- Audit time display and manual refresh button
- Connection test button in settings
- Check ID to human-readable name mapping
- Enhanced error messages with context
Technical improvements:
- Added triggerRefresh to PolarisDataContext for manual refresh
- Created checkMapping.ts for check metadata
- Created topIssues.ts for extracting common failures
- Enhanced DashboardView with top issues and refresh
- Enhanced PolarisSettings with connection test
- Created InlineAuditSection for details view integration
- Created AppBarScoreBadge for app bar integration
- Created ExemptionManager for annotation patches
UI enhancements:
- 1000px namespace detail panel
- Theme-aware styling throughout
- Improved formatting and layout
- Better status indicators
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>