@pennyfarthing/cyclist 10.4.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/agent-load.d.ts +1 -2
- package/dist/api/agent-load.d.ts.map +1 -1
- package/dist/api/agent-load.js +2 -123
- package/dist/api/agent-load.js.map +1 -1
- package/dist/api/audit-log.d.ts +1 -17
- package/dist/api/audit-log.d.ts.map +1 -1
- package/dist/api/audit-log.js +2 -162
- package/dist/api/audit-log.js.map +1 -1
- package/dist/api/background-tasks.d.ts +1 -26
- package/dist/api/background-tasks.d.ts.map +1 -1
- package/dist/api/background-tasks.js +2 -55
- package/dist/api/background-tasks.js.map +1 -1
- package/dist/api/bell.d.ts +1 -18
- package/dist/api/bell.d.ts.map +1 -1
- package/dist/api/bell.js +2 -33
- package/dist/api/bell.js.map +1 -1
- package/dist/api/code-markers.d.ts +1 -8
- package/dist/api/code-markers.d.ts.map +1 -1
- package/dist/api/code-markers.js +2 -61
- package/dist/api/code-markers.js.map +1 -1
- package/dist/api/complexity.d.ts +1 -2
- package/dist/api/complexity.d.ts.map +1 -1
- package/dist/api/complexity.js +2 -46
- package/dist/api/complexity.js.map +1 -1
- package/dist/api/context.d.ts +1 -37
- package/dist/api/context.d.ts.map +1 -1
- package/dist/api/context.js +2 -143
- package/dist/api/context.js.map +1 -1
- package/dist/api/dead-code.d.ts +1 -2
- package/dist/api/dead-code.d.ts.map +1 -1
- package/dist/api/dead-code.js +2 -69
- package/dist/api/dead-code.js.map +1 -1
- package/dist/api/dependencies.d.ts +1 -2
- package/dist/api/dependencies.d.ts.map +1 -1
- package/dist/api/dependencies.js +2 -42
- package/dist/api/dependencies.js.map +1 -1
- package/dist/api/evaluation.d.ts +1 -19
- package/dist/api/evaluation.d.ts.map +1 -1
- package/dist/api/evaluation.js +2 -127
- package/dist/api/evaluation.js.map +1 -1
- package/dist/api/file-browser.d.ts +1 -8
- package/dist/api/file-browser.d.ts.map +1 -1
- package/dist/api/file-browser.js +2 -114
- package/dist/api/file-browser.js.map +1 -1
- package/dist/api/git.d.ts +1 -46
- package/dist/api/git.d.ts.map +1 -1
- package/dist/api/git.js +2 -354
- package/dist/api/git.js.map +1 -1
- package/dist/api/health-score.d.ts +1 -2
- package/dist/api/health-score.d.ts.map +1 -1
- package/dist/api/health-score.js +2 -46
- package/dist/api/health-score.js.map +1 -1
- package/dist/api/hook-request.d.ts +1 -40
- package/dist/api/hook-request.d.ts.map +1 -1
- package/dist/api/hook-request.js +2 -277
- package/dist/api/hook-request.js.map +1 -1
- package/dist/api/hotspots.d.ts +1 -2
- package/dist/api/hotspots.d.ts.map +1 -1
- package/dist/api/hotspots.js +2 -61
- package/dist/api/hotspots.js.map +1 -1
- package/dist/api/identity.d.ts +1 -16
- package/dist/api/identity.d.ts.map +1 -1
- package/dist/api/identity.js +2 -78
- package/dist/api/identity.js.map +1 -1
- package/dist/api/index.d.ts +1 -34
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +2 -44
- package/dist/api/index.js.map +1 -1
- package/dist/api/mode.d.ts +1 -22
- package/dist/api/mode.d.ts.map +1 -1
- package/dist/api/mode.js +2 -37
- package/dist/api/mode.js.map +1 -1
- package/dist/api/otlp.d.ts +1 -2
- package/dist/api/otlp.d.ts.map +1 -1
- package/dist/api/otlp.js +2 -46
- package/dist/api/otlp.js.map +1 -1
- package/dist/api/permissions.d.ts +1 -15
- package/dist/api/permissions.d.ts.map +1 -1
- package/dist/api/permissions.js +2 -66
- package/dist/api/permissions.js.map +1 -1
- package/dist/api/persona.d.ts +1 -8
- package/dist/api/persona.d.ts.map +1 -1
- package/dist/api/persona.js +2 -67
- package/dist/api/persona.js.map +1 -1
- package/dist/api/portrait.d.ts +1 -5
- package/dist/api/portrait.d.ts.map +1 -1
- package/dist/api/portrait.js +2 -27
- package/dist/api/portrait.js.map +1 -1
- package/dist/api/settings.d.ts +1 -53
- package/dist/api/settings.d.ts.map +1 -1
- package/dist/api/settings.js +2 -464
- package/dist/api/settings.js.map +1 -1
- package/dist/api/spans.d.ts +1 -16
- package/dist/api/spans.d.ts.map +1 -1
- package/dist/api/spans.js +2 -244
- package/dist/api/spans.js.map +1 -1
- package/dist/api/stats.d.ts +1 -12
- package/dist/api/stats.d.ts.map +1 -1
- package/dist/api/stats.js +2 -84
- package/dist/api/stats.js.map +1 -1
- package/dist/api/story.d.ts +1 -2
- package/dist/api/story.d.ts.map +1 -1
- package/dist/api/story.js +2 -14
- package/dist/api/story.js.map +1 -1
- package/dist/api/telemetry.d.ts +1 -18
- package/dist/api/telemetry.d.ts.map +1 -1
- package/dist/api/telemetry.js +2 -164
- package/dist/api/telemetry.js.map +1 -1
- package/dist/api/theme-agents.d.ts +1 -60
- package/dist/api/theme-agents.d.ts.map +1 -1
- package/dist/api/theme-agents.js +2 -213
- package/dist/api/theme-agents.js.map +1 -1
- package/dist/api/todos.d.ts +1 -32
- package/dist/api/todos.d.ts.map +1 -1
- package/dist/api/todos.js +2 -43
- package/dist/api/todos.js.map +1 -1
- package/dist/api/token-stats.d.ts +1 -7
- package/dist/api/token-stats.d.ts.map +1 -1
- package/dist/api/token-stats.js +2 -35
- package/dist/api/token-stats.js.map +1 -1
- package/dist/api/welcome.d.ts +1 -21
- package/dist/api/welcome.d.ts.map +1 -1
- package/dist/api/welcome.js +2 -34
- package/dist/api/welcome.js.map +1 -1
- package/dist/bikerack.js +2 -2
- package/dist/bikerack.js.map +1 -1
- package/dist/env.d.ts +6 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +10 -0
- package/dist/env.js.map +1 -0
- package/dist/focus.d.ts +53 -0
- package/dist/focus.d.ts.map +1 -0
- package/dist/focus.js +122 -0
- package/dist/focus.js.map +1 -0
- package/dist/git-cache.d.ts +1 -0
- package/dist/git-cache.d.ts.map +1 -1
- package/dist/git-cache.js +3 -1
- package/dist/git-cache.js.map +1 -1
- package/dist/menu-builder.d.ts.map +1 -1
- package/dist/menu-builder.js +0 -1
- package/dist/menu-builder.js.map +1 -1
- package/dist/prime.d.ts +3 -3
- package/dist/prime.d.ts.map +1 -1
- package/dist/prime.js +38 -14
- package/dist/prime.js.map +1 -1
- package/dist/public/css/react.css +1 -1
- package/dist/public/js/react/react.js +53 -61
- package/dist/server.d.ts +18 -85
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +105 -405
- package/dist/server.js.map +1 -1
- package/dist/sprint-data.d.ts +1 -1
- package/dist/sprint-data.d.ts.map +1 -1
- package/dist/sprint-data.js +2 -2
- package/dist/sprint-data.js.map +1 -1
- package/dist/theme-metadata.d.ts +3 -3
- package/dist/theme-metadata.d.ts.map +1 -1
- package/dist/theme-metadata.js +4 -4
- package/dist/theme-metadata.js.map +1 -1
- package/dist/websocket.d.ts +2 -0
- package/dist/websocket.d.ts.map +1 -1
- package/dist/websocket.js +53 -75
- package/dist/websocket.js.map +1 -1
- package/package.json +2 -6
- package/portraits/hogans-heroes/large/burkhalter-35312.png +0 -0
- package/portraits/hogans-heroes/large/carter-34352.png +0 -0
- package/portraits/hogans-heroes/large/hochstetter-45314.png +0 -0
- package/portraits/hogans-heroes/large/hogan-44541.png +0 -0
- package/portraits/hogans-heroes/large/kinch-35241.png +0 -0
- package/portraits/hogans-heroes/large/klink-23434.png +0 -0
- package/portraits/hogans-heroes/large/lebeau-45443.png +0 -0
- package/portraits/hogans-heroes/large/marya-53543.png +0 -0
- package/portraits/hogans-heroes/large/newkirk-54432.png +0 -0
- package/portraits/hogans-heroes/large/schultz-42453.png +0 -0
- package/portraits/hogans-heroes/large/underground-55131.png +0 -0
- package/portraits/hogans-heroes/medium/burkhalter-35312.png +0 -0
- package/portraits/hogans-heroes/medium/carter-34352.png +0 -0
- package/portraits/hogans-heroes/medium/hochstetter-45314.png +0 -0
- package/portraits/hogans-heroes/medium/hogan-44541.png +0 -0
- package/portraits/hogans-heroes/medium/kinch-35241.png +0 -0
- package/portraits/hogans-heroes/medium/klink-23434.png +0 -0
- package/portraits/hogans-heroes/medium/lebeau-45443.png +0 -0
- package/portraits/hogans-heroes/medium/marya-53543.png +0 -0
- package/portraits/hogans-heroes/medium/newkirk-54432.png +0 -0
- package/portraits/hogans-heroes/medium/schultz-42453.png +0 -0
- package/portraits/hogans-heroes/medium/underground-55131.png +0 -0
- package/portraits/monty-python/large/announcer-44441.png +0 -0
- package/portraits/monty-python/large/arguer-35412.png +0 -0
- package/portraits/monty-python/large/bicycle-repair-man-35241.png +0 -0
- package/portraits/monty-python/large/colonel-35423.png +0 -0
- package/portraits/monty-python/large/counsellor-45341.png +0 -0
- package/portraits/monty-python/large/gumbys-23524.png +0 -0
- package/portraits/monty-python/large/nudge-43533.png +0 -0
- package/portraits/monty-python/large/praline-45413.png +0 -0
- package/portraits/monty-python/large/silly-walks-55322.png +0 -0
- package/portraits/monty-python/large/wensleydale-54451.png +0 -0
- package/portraits/monty-python/large/xim-nez-43534.png +0 -0
- package/portraits/monty-python/medium/announcer-44441.png +0 -0
- package/portraits/monty-python/medium/arguer-35412.png +0 -0
- package/portraits/monty-python/medium/bicycle-repair-man-35241.png +0 -0
- package/portraits/monty-python/medium/colonel-35423.png +0 -0
- package/portraits/monty-python/medium/counsellor-45341.png +0 -0
- package/portraits/monty-python/medium/gumbys-23524.png +0 -0
- package/portraits/monty-python/medium/nudge-43533.png +0 -0
- package/portraits/monty-python/medium/praline-45413.png +0 -0
- package/portraits/monty-python/medium/silly-walks-55322.png +0 -0
- package/portraits/monty-python/medium/wensleydale-54451.png +0 -0
- package/portraits/monty-python/medium/xim-nez-43534.png +0 -0
- package/portraits/stephen-king/large/andy-55231.png +0 -0
- package/portraits/stephen-king/large/christine-25112.png +0 -0
- package/portraits/stephen-king/large/danny-53243.png +0 -0
- package/portraits/stephen-king/large/flagg-55311.png +0 -0
- package/portraits/stephen-king/large/gaunt-54421.png +0 -0
- package/portraits/stephen-king/large/jack-44224.png +0 -0
- package/portraits/stephen-king/large/johnny-44353.png +0 -0
- package/portraits/stephen-king/large/margaret-15415.png +0 -0
- package/portraits/stephen-king/large/paul-45233.png +0 -0
- package/portraits/stephen-king/large/pennywise-54411.png +0 -0
- package/portraits/stephen-king/large/roland-35121.png +0 -0
- package/portraits/stephen-king/medium/andy-55231.png +0 -0
- package/portraits/stephen-king/medium/christine-25112.png +0 -0
- package/portraits/stephen-king/medium/danny-53243.png +0 -0
- package/portraits/stephen-king/medium/flagg-55311.png +0 -0
- package/portraits/stephen-king/medium/gaunt-54421.png +0 -0
- package/portraits/stephen-king/medium/jack-44224.png +0 -0
- package/portraits/stephen-king/medium/johnny-44353.png +0 -0
- package/portraits/stephen-king/medium/margaret-15415.png +0 -0
- package/portraits/stephen-king/medium/paul-45233.png +0 -0
- package/portraits/stephen-king/medium/pennywise-54411.png +0 -0
- package/portraits/stephen-king/medium/roland-35121.png +0 -0
- package/portraits/star-trek-tng/large/beverly-44352.png +0 -0
- package/portraits/star-trek-tng/large/data-55241.png +0 -0
- package/portraits/star-trek-tng/large/deanna-43353.png +0 -0
- package/portraits/star-trek-tng/large/geordi-54342.png +0 -0
- package/portraits/star-trek-tng/large/jean-luc-45342.png +0 -0
- package/portraits/star-trek-tng/large/kathryn-45332.png +0 -0
- package/portraits/star-trek-tng/large/miles-35342.png +0 -0
- package/portraits/star-trek-tng/large/q-53521.png +0 -0
- package/portraits/star-trek-tng/large/spock-45231.png +0 -0
- package/portraits/star-trek-tng/large/troi-44352.png +0 -0
- package/portraits/star-trek-tng/medium/beverly-44352.png +0 -0
- package/portraits/star-trek-tng/medium/data-55241.png +0 -0
- package/portraits/star-trek-tng/medium/deanna-43353.png +0 -0
- package/portraits/star-trek-tng/medium/geordi-54342.png +0 -0
- package/portraits/star-trek-tng/medium/jean-luc-45342.png +0 -0
- package/portraits/star-trek-tng/medium/kathryn-45332.png +0 -0
- package/portraits/star-trek-tng/medium/miles-35342.png +0 -0
- package/portraits/star-trek-tng/medium/q-53521.png +0 -0
- package/portraits/star-trek-tng/medium/spock-45231.png +0 -0
- package/portraits/star-trek-tng/medium/troi-44352.png +0 -0
- package/src/public/App.tsx +0 -340
- package/src/public/components/AgentLoadDialog.tsx +0 -202
- package/src/public/components/AgentPopup.tsx +0 -308
- package/src/public/components/ApprovalModal/ApprovalModal.css +0 -35
- package/src/public/components/ApprovalModal/index.tsx +0 -632
- package/src/public/components/BikeRackIndex.tsx +0 -54
- package/src/public/components/BikeRackWorkspace.tsx +0 -142
- package/src/public/components/CommandPalette.tsx +0 -555
- package/src/public/components/ConfirmDialog.tsx +0 -168
- package/src/public/components/ContextIndicator/ContextIndicator.css +0 -85
- package/src/public/components/ContextIndicator/index.tsx +0 -330
- package/src/public/components/ContextSparkline.tsx +0 -56
- package/src/public/components/ControlBar.tsx +0 -636
- package/src/public/components/DeadCodeDialog.tsx +0 -169
- package/src/public/components/DiffViewer.tsx +0 -585
- package/src/public/components/DockviewWorkspace.tsx +0 -737
- package/src/public/components/Editor.tsx +0 -630
- package/src/public/components/ErrorBoundary.tsx +0 -67
- package/src/public/components/FileTree.tsx +0 -379
- package/src/public/components/FontPicker/FontPicker.css +0 -276
- package/src/public/components/FontPicker/index.tsx +0 -430
- package/src/public/components/FullFileTree.tsx +0 -237
- package/src/public/components/HealthGauge.tsx +0 -181
- package/src/public/components/Message.tsx +0 -225
- package/src/public/components/MessageList.tsx +0 -98
- package/src/public/components/MessageView.tsx +0 -400
- package/src/public/components/ModeSwitch/ModeSwitch.css +0 -165
- package/src/public/components/ModeSwitch/index.tsx +0 -372
- package/src/public/components/PersonaHeader.tsx +0 -240
- package/src/public/components/QuickActions.tsx +0 -267
- package/src/public/components/SpanTimeline.tsx +0 -352
- package/src/public/components/StandalonePanel.tsx +0 -84
- package/src/public/components/StatsStrip.tsx +0 -162
- package/src/public/components/StreamingContent.tsx +0 -77
- package/src/public/components/SubagentSpan.tsx +0 -180
- package/src/public/components/TandemPortrait.tsx +0 -72
- package/src/public/components/ThemePalette/ThemePalette.css +0 -179
- package/src/public/components/ThemePalette/index.tsx +0 -326
- package/src/public/components/ToolCallBlock.tsx +0 -252
- package/src/public/components/ToolStack.tsx +0 -209
- package/src/public/components/ToolStatus.tsx +0 -57
- package/src/public/components/dialogs/CodeMarkersDialog.tsx +0 -169
- package/src/public/components/dialogs/ComplexityDialog.tsx +0 -163
- package/src/public/components/dialogs/DependenciesDialog.tsx +0 -120
- package/src/public/components/dialogs/HotspotsDialog.tsx +0 -451
- package/src/public/components/dialogs/ToolDialog.tsx +0 -43
- package/src/public/components/panel-registry.ts +0 -11
- package/src/public/components/panels/ACPanel.tsx +0 -93
- package/src/public/components/panels/AcceptanceCriteriaPanel.tsx +0 -104
- package/src/public/components/panels/AuditLogPanel.tsx +0 -465
- package/src/public/components/panels/BackgroundPanel.tsx +0 -115
- package/src/public/components/panels/BikeLanePanel.tsx +0 -214
- package/src/public/components/panels/ChangedPanel.tsx +0 -65
- package/src/public/components/panels/DebugPanel.tsx +0 -344
- package/src/public/components/panels/DiffsPanel.tsx +0 -155
- package/src/public/components/panels/GitPanel.tsx +0 -216
- package/src/public/components/panels/HotspotsPanel.tsx +0 -365
- package/src/public/components/panels/MessagePanel.tsx +0 -497
- package/src/public/components/panels/SettingsPanel.tsx +0 -453
- package/src/public/components/panels/SprintPanel.tsx +0 -670
- package/src/public/components/panels/TTYPanel.tsx +0 -299
- package/src/public/components/panels/TodoPanel.tsx +0 -142
- package/src/public/components/panels/WorkflowPanel.tsx +0 -224
- package/src/public/components/panels/index.ts +0 -24
- package/src/public/components/ui/alert-dialog.tsx +0 -139
- package/src/public/components/ui/badge.tsx +0 -36
- package/src/public/components/ui/button.tsx +0 -57
- package/src/public/components/ui/checkbox.tsx +0 -28
- package/src/public/components/ui/collapsible.tsx +0 -9
- package/src/public/components/ui/command.tsx +0 -151
- package/src/public/components/ui/dialog.tsx +0 -120
- package/src/public/components/ui/popover.tsx +0 -31
- package/src/public/components/ui/progress.tsx +0 -28
- package/src/public/components/ui/scroll-area.tsx +0 -46
- package/src/public/components/ui/select.tsx +0 -157
- package/src/public/components/ui/separator.tsx +0 -29
- package/src/public/components/ui/skeleton.tsx +0 -15
- package/src/public/components/ui/switch.tsx +0 -27
- package/src/public/components/ui/toggle-group.tsx +0 -59
- package/src/public/components/ui/toggle.tsx +0 -43
- package/src/public/components/ui/tooltip.tsx +0 -30
- package/src/public/contexts/ClaudeContext.tsx +0 -311
- package/src/public/contexts/MessageQueueContext.tsx +0 -143
- package/src/public/css/theme-browser.css +0 -550
- package/src/public/css/theme-system.css +0 -630
- package/src/public/hooks/index.ts +0 -49
- package/src/public/hooks/useAgentLoad.ts +0 -105
- package/src/public/hooks/useBackgroundTasks.ts +0 -131
- package/src/public/hooks/useClaude.ts +0 -234
- package/src/public/hooks/useCodeMarkers.ts +0 -101
- package/src/public/hooks/useColorScheme.ts +0 -42
- package/src/public/hooks/useCommandHistory.ts +0 -99
- package/src/public/hooks/useComplexity.ts +0 -80
- package/src/public/hooks/useDeadCode.ts +0 -99
- package/src/public/hooks/useDependencies.ts +0 -82
- package/src/public/hooks/useDiffs.ts +0 -143
- package/src/public/hooks/useFileBrowser.ts +0 -71
- package/src/public/hooks/useGitStatus.ts +0 -233
- package/src/public/hooks/useHealthScore.ts +0 -69
- package/src/public/hooks/useHotspots.ts +0 -123
- package/src/public/hooks/useLayoutPersistence.ts +0 -138
- package/src/public/hooks/useMarkdownParser.ts +0 -36
- package/src/public/hooks/useMarkerActions.ts +0 -234
- package/src/public/hooks/useMessageQueue.ts +0 -380
- package/src/public/hooks/useMessageStream.ts +0 -131
- package/src/public/hooks/usePersona.ts +0 -112
- package/src/public/hooks/usePlanModeExit.ts +0 -105
- package/src/public/hooks/useResponsiveLayout.ts +0 -173
- package/src/public/hooks/useSprint.ts +0 -147
- package/src/public/hooks/useStatsStrip.ts +0 -204
- package/src/public/hooks/useStory.ts +0 -135
- package/src/public/hooks/useSubagentHelper.ts +0 -64
- package/src/public/hooks/useSyntaxHighlighter.ts +0 -52
- package/src/public/hooks/useTabCompletion.ts +0 -124
- package/src/public/hooks/useTodos.ts +0 -93
- package/src/public/hooks/useUserAvatar.ts +0 -54
- package/src/public/index.tsx +0 -10
- package/src/public/lib/utils.ts +0 -6
- package/src/public/styles/dockview-theme.css +0 -459
- package/src/public/styles/tailwind.css +0 -4396
- package/src/public/types/electron.d.ts +0 -18
- package/src/public/types/message.ts +0 -51
- package/src/public/utils/avatar-service.ts +0 -73
- package/src/public/utils/color-presets.ts +0 -940
- package/src/public/utils/font-presets.ts +0 -362
- package/src/public/utils/formatDuration.ts +0 -14
- package/src/public/utils/markdown.ts +0 -249
- package/src/public/utils/messageFilters.ts +0 -128
- package/src/public/utils/slash-commands.ts +0 -353
- package/src/public/utils/subagent-display.ts +0 -146
- package/src/public/utils/syntax.ts +0 -219
- package/src/public/utils/toolIntentSummarizer.ts +0 -199
- package/src/public/utils/toolStackGrouper.ts +0 -106
- package/src/public/utils/toolTypeColors.ts +0 -45
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitPanel - Display git repository status
|
|
3
|
-
*
|
|
4
|
-
* Story MSSCI-12717 - React Migration
|
|
5
|
-
* Story MSSCI-12798 - Stacked multi-repo display with file dropdowns
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React, { useState } from 'react';
|
|
9
|
-
import { RefreshCw } from 'lucide-react';
|
|
10
|
-
import { Button } from '@/components/ui/button';
|
|
11
|
-
import { Badge } from '@/components/ui/badge';
|
|
12
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
|
13
|
-
import { Skeleton } from '@/components/ui/skeleton';
|
|
14
|
-
import { useGitStatus, RepoStatusData, DirtyFile } from '../../hooks/useGitStatus';
|
|
15
|
-
import { useClaudeContext } from '../../contexts/ClaudeContext';
|
|
16
|
-
|
|
17
|
-
/** Get CSS class for file status */
|
|
18
|
-
function getFileStatusClass(status: string): string {
|
|
19
|
-
const indexStatus = status[0] || ' ';
|
|
20
|
-
const workTreeStatus = status[1] || ' ';
|
|
21
|
-
|
|
22
|
-
if (indexStatus === '?' && workTreeStatus === '?') return 'untracked';
|
|
23
|
-
if (indexStatus !== ' ' && indexStatus !== '?') return 'staged';
|
|
24
|
-
if (workTreeStatus === 'M' || workTreeStatus === 'D') return 'modified';
|
|
25
|
-
return 'modified';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** Get display label for file status */
|
|
29
|
-
function getFileStatusLabel(status: string): string {
|
|
30
|
-
const indexStatus = status[0] || ' ';
|
|
31
|
-
const workTreeStatus = status[1] || ' ';
|
|
32
|
-
|
|
33
|
-
if (indexStatus === '?' && workTreeStatus === '?') return '?';
|
|
34
|
-
if (indexStatus === 'A') return '+';
|
|
35
|
-
if (indexStatus === 'D' || workTreeStatus === 'D') return '-';
|
|
36
|
-
if (indexStatus === 'M' || workTreeStatus === 'M') return '~';
|
|
37
|
-
if (indexStatus === 'R') return 'R';
|
|
38
|
-
return status.trim() || '~';
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
interface FileListProps {
|
|
42
|
-
files: DirtyFile[];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function FileList({ files }: FileListProps): React.ReactElement {
|
|
46
|
-
return (
|
|
47
|
-
<ul className="file-list">
|
|
48
|
-
{files.map((file, index) => (
|
|
49
|
-
<li key={`${file.path}-${index}`} className={`file-item ${getFileStatusClass(file.status)}`}>
|
|
50
|
-
<span className="file-status-icon">{getFileStatusLabel(file.status)}</span>
|
|
51
|
-
<Tooltip>
|
|
52
|
-
<TooltipTrigger asChild>
|
|
53
|
-
<span className="file-path">{file.path}</span>
|
|
54
|
-
</TooltipTrigger>
|
|
55
|
-
<TooltipContent>{file.path}</TooltipContent>
|
|
56
|
-
</Tooltip>
|
|
57
|
-
</li>
|
|
58
|
-
))}
|
|
59
|
-
</ul>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
interface RepoStatusProps {
|
|
64
|
-
repo: RepoStatusData;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function RepoStatus({ repo }: RepoStatusProps): React.ReactElement {
|
|
68
|
-
const [isExpanded, setIsExpanded] = useState(false);
|
|
69
|
-
const { name, branch, ahead, behind, developBehind, staged, modified, untracked, isDirty, files } = repo;
|
|
70
|
-
const hasFiles = files.length > 0;
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<TooltipProvider delayDuration={300}>
|
|
74
|
-
<div className={`repo-status ${isExpanded ? 'expanded' : ''}`} data-testid={`repo-status-${name}`}>
|
|
75
|
-
<div className="repo-header">
|
|
76
|
-
<span className="repo-name">{name}</span>
|
|
77
|
-
{isDirty && (
|
|
78
|
-
<Tooltip>
|
|
79
|
-
<TooltipTrigger asChild>
|
|
80
|
-
<Badge variant="destructive" className="dirty-indicator">●</Badge>
|
|
81
|
-
</TooltipTrigger>
|
|
82
|
-
<TooltipContent>Uncommitted changes</TooltipContent>
|
|
83
|
-
</Tooltip>
|
|
84
|
-
)}
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
<div className="branch-info">
|
|
88
|
-
<span className="branch-icon">⎇</span>
|
|
89
|
-
<span className="branch-name">{branch}</span>
|
|
90
|
-
</div>
|
|
91
|
-
|
|
92
|
-
{((ahead !== undefined && ahead > 0) || (behind !== undefined && behind > 0) || (developBehind !== undefined && developBehind > 0)) && (
|
|
93
|
-
<div className="sync-status">
|
|
94
|
-
{ahead !== undefined && ahead > 0 && (
|
|
95
|
-
<Tooltip>
|
|
96
|
-
<TooltipTrigger asChild>
|
|
97
|
-
<span className="ahead">↑{ahead}</span>
|
|
98
|
-
</TooltipTrigger>
|
|
99
|
-
<TooltipContent>Commits ahead of remote</TooltipContent>
|
|
100
|
-
</Tooltip>
|
|
101
|
-
)}
|
|
102
|
-
{behind !== undefined && behind > 0 && (
|
|
103
|
-
<Tooltip>
|
|
104
|
-
<TooltipTrigger asChild>
|
|
105
|
-
<span className="behind">↓{behind}</span>
|
|
106
|
-
</TooltipTrigger>
|
|
107
|
-
<TooltipContent>Commits behind remote</TooltipContent>
|
|
108
|
-
</Tooltip>
|
|
109
|
-
)}
|
|
110
|
-
{developBehind !== undefined && developBehind > 0 && (
|
|
111
|
-
<Tooltip>
|
|
112
|
-
<TooltipTrigger asChild>
|
|
113
|
-
<span className="develop-behind">⟳{developBehind}</span>
|
|
114
|
-
</TooltipTrigger>
|
|
115
|
-
<TooltipContent>develop is {developBehind} commit{developBehind > 1 ? 's' : ''} ahead</TooltipContent>
|
|
116
|
-
</Tooltip>
|
|
117
|
-
)}
|
|
118
|
-
</div>
|
|
119
|
-
)}
|
|
120
|
-
|
|
121
|
-
{(staged > 0 || modified > 0 || untracked > 0) && (
|
|
122
|
-
<Tooltip>
|
|
123
|
-
<TooltipTrigger asChild>
|
|
124
|
-
<Button
|
|
125
|
-
variant="ghost"
|
|
126
|
-
className="file-status-toggle"
|
|
127
|
-
onClick={() => setIsExpanded(!isExpanded)}
|
|
128
|
-
>
|
|
129
|
-
<span className={`toggle-icon ${isExpanded ? 'open' : ''}`}>▶</span>
|
|
130
|
-
<div className="file-status">
|
|
131
|
-
{staged > 0 && (
|
|
132
|
-
<Badge variant="outline" className="status-item staged">+{staged}</Badge>
|
|
133
|
-
)}
|
|
134
|
-
{modified > 0 && (
|
|
135
|
-
<Badge variant="outline" className="status-item modified">~{modified}</Badge>
|
|
136
|
-
)}
|
|
137
|
-
{untracked > 0 && (
|
|
138
|
-
<Badge variant="outline" className="status-item untracked">?{untracked}</Badge>
|
|
139
|
-
)}
|
|
140
|
-
</div>
|
|
141
|
-
</Button>
|
|
142
|
-
</TooltipTrigger>
|
|
143
|
-
<TooltipContent>{isExpanded ? 'Collapse file list' : 'Expand file list'}</TooltipContent>
|
|
144
|
-
</Tooltip>
|
|
145
|
-
)}
|
|
146
|
-
|
|
147
|
-
{isExpanded && hasFiles && <FileList files={files} />}
|
|
148
|
-
</div>
|
|
149
|
-
</TooltipProvider>
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export function GitPanel(): React.ReactElement {
|
|
154
|
-
const { repos, isLoading, error } = useGitStatus();
|
|
155
|
-
const { send } = useClaudeContext();
|
|
156
|
-
|
|
157
|
-
const handleSyncAll = () => {
|
|
158
|
-
send('Sync all repos');
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
if (isLoading) {
|
|
162
|
-
return (
|
|
163
|
-
<div className="git-panel loading" data-testid="git-panel">
|
|
164
|
-
<div className="space-y-3 p-2">
|
|
165
|
-
<div className="space-y-1">
|
|
166
|
-
<Skeleton className="h-4 w-32" />
|
|
167
|
-
<Skeleton className="h-3 w-24" />
|
|
168
|
-
</div>
|
|
169
|
-
<div className="space-y-1">
|
|
170
|
-
<Skeleton className="h-4 w-28" />
|
|
171
|
-
<Skeleton className="h-3 w-20" />
|
|
172
|
-
</div>
|
|
173
|
-
</div>
|
|
174
|
-
</div>
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
if (error) {
|
|
179
|
-
return (
|
|
180
|
-
<div className="git-panel error" data-testid="git-panel">
|
|
181
|
-
<div className="error-message">{error.message}</div>
|
|
182
|
-
</div>
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
if (repos.length === 0) {
|
|
187
|
-
return (
|
|
188
|
-
<div className="git-panel empty" data-testid="git-panel">
|
|
189
|
-
<div className="placeholder">No git repos</div>
|
|
190
|
-
</div>
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return (
|
|
195
|
-
<div className="git-panel stacked" data-testid="git-panel">
|
|
196
|
-
<div className="git-panel-actions">
|
|
197
|
-
<TooltipProvider delayDuration={300}>
|
|
198
|
-
<Tooltip>
|
|
199
|
-
<TooltipTrigger asChild>
|
|
200
|
-
<button className="sync-all-btn" onClick={handleSyncAll} aria-label="Sync all repos">
|
|
201
|
-
<RefreshCw size={14} />
|
|
202
|
-
<span>Sync all repos</span>
|
|
203
|
-
</button>
|
|
204
|
-
</TooltipTrigger>
|
|
205
|
-
<TooltipContent>Pull latest changes for all repos</TooltipContent>
|
|
206
|
-
</Tooltip>
|
|
207
|
-
</TooltipProvider>
|
|
208
|
-
</div>
|
|
209
|
-
{repos.map(repo => (
|
|
210
|
-
<RepoStatus key={repo.name} repo={repo} />
|
|
211
|
-
))}
|
|
212
|
-
</div>
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export default GitPanel;
|
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HotspotsPanel - Git history hotspot detector
|
|
3
|
-
*
|
|
4
|
-
* Shows files and directories with highest change frequency, bug fix concentration,
|
|
5
|
-
* and multi-author churn. Sortable table with time window controls.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React, { useState, useMemo, useCallback } from 'react';
|
|
9
|
-
import { Button } from '@/components/ui/button';
|
|
10
|
-
import { Badge } from '@/components/ui/badge';
|
|
11
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
|
12
|
-
import { Skeleton } from '@/components/ui/skeleton';
|
|
13
|
-
import { useHotspots, FileHotspot, DirectoryHotspot, HotspotRepoResult } from '../../hooks/useHotspots';
|
|
14
|
-
|
|
15
|
-
type SortField = 'hotspot_score' | 'change_count' | 'bug_fix_count' | 'author_count' | 'churn' | 'path';
|
|
16
|
-
type SortDirection = 'asc' | 'desc';
|
|
17
|
-
type ViewMode = 'files' | 'dirs';
|
|
18
|
-
|
|
19
|
-
const TIME_WINDOWS = [30, 60, 90] as const;
|
|
20
|
-
|
|
21
|
-
function SortableHeader({
|
|
22
|
-
label,
|
|
23
|
-
field,
|
|
24
|
-
currentSort,
|
|
25
|
-
currentDirection,
|
|
26
|
-
onSort,
|
|
27
|
-
align = 'right',
|
|
28
|
-
}: {
|
|
29
|
-
label: string;
|
|
30
|
-
field: SortField;
|
|
31
|
-
currentSort: SortField;
|
|
32
|
-
currentDirection: SortDirection;
|
|
33
|
-
onSort: (field: SortField) => void;
|
|
34
|
-
align?: 'left' | 'right';
|
|
35
|
-
}) {
|
|
36
|
-
const isActive = currentSort === field;
|
|
37
|
-
const arrow = isActive ? (currentDirection === 'desc' ? ' v' : ' ^') : '';
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<th
|
|
41
|
-
className={`hotspots-th ${align === 'left' ? 'text-left' : 'text-right'} ${isActive ? 'active' : ''}`}
|
|
42
|
-
onClick={() => onSort(field)}
|
|
43
|
-
role="columnheader"
|
|
44
|
-
aria-sort={isActive ? (currentDirection === 'desc' ? 'descending' : 'ascending') : 'none'}
|
|
45
|
-
style={{ cursor: 'pointer', userSelect: 'none' }}
|
|
46
|
-
>
|
|
47
|
-
{label}{arrow}
|
|
48
|
-
</th>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function FileTable({
|
|
53
|
-
hotspots,
|
|
54
|
-
sortField,
|
|
55
|
-
sortDirection,
|
|
56
|
-
onSort,
|
|
57
|
-
}: {
|
|
58
|
-
hotspots: FileHotspot[];
|
|
59
|
-
sortField: SortField;
|
|
60
|
-
sortDirection: SortDirection;
|
|
61
|
-
onSort: (field: SortField) => void;
|
|
62
|
-
}) {
|
|
63
|
-
const sorted = useMemo(() => {
|
|
64
|
-
const items = [...hotspots];
|
|
65
|
-
items.sort((a, b) => {
|
|
66
|
-
const aVal = a[sortField as keyof FileHotspot];
|
|
67
|
-
const bVal = b[sortField as keyof FileHotspot];
|
|
68
|
-
if (typeof aVal === 'number' && typeof bVal === 'number') {
|
|
69
|
-
return sortDirection === 'desc' ? bVal - aVal : aVal - bVal;
|
|
70
|
-
}
|
|
71
|
-
const aStr = String(aVal);
|
|
72
|
-
const bStr = String(bVal);
|
|
73
|
-
return sortDirection === 'desc' ? bStr.localeCompare(aStr) : aStr.localeCompare(bStr);
|
|
74
|
-
});
|
|
75
|
-
return items;
|
|
76
|
-
}, [hotspots, sortField, sortDirection]);
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<table className="hotspots-table" role="table">
|
|
80
|
-
<thead>
|
|
81
|
-
<tr>
|
|
82
|
-
<SortableHeader label="Score" field="hotspot_score" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
83
|
-
<SortableHeader label="Changes" field="change_count" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
84
|
-
<SortableHeader label="Fixes" field="bug_fix_count" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
85
|
-
<SortableHeader label="Authors" field="author_count" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
86
|
-
<SortableHeader label="Churn" field="churn" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
87
|
-
<SortableHeader label="File" field="path" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} align="left" />
|
|
88
|
-
</tr>
|
|
89
|
-
</thead>
|
|
90
|
-
<tbody>
|
|
91
|
-
{sorted.map((h) => (
|
|
92
|
-
<tr key={h.path}>
|
|
93
|
-
<td className="text-right">
|
|
94
|
-
<Badge variant={h.hotspot_score >= 50 ? 'destructive' : h.hotspot_score >= 25 ? 'outline' : 'secondary'}>
|
|
95
|
-
{h.hotspot_score.toFixed(1)}
|
|
96
|
-
</Badge>
|
|
97
|
-
</td>
|
|
98
|
-
<td className="text-right">{h.change_count}</td>
|
|
99
|
-
<td className="text-right">{h.bug_fix_count}</td>
|
|
100
|
-
<td className="text-right">{h.author_count}</td>
|
|
101
|
-
<td className="text-right">{h.churn}</td>
|
|
102
|
-
<td className="text-left">
|
|
103
|
-
<Tooltip>
|
|
104
|
-
<TooltipTrigger asChild>
|
|
105
|
-
<span className="hotspots-filepath">{h.path}</span>
|
|
106
|
-
</TooltipTrigger>
|
|
107
|
-
<TooltipContent>{h.path}</TooltipContent>
|
|
108
|
-
</Tooltip>
|
|
109
|
-
</td>
|
|
110
|
-
</tr>
|
|
111
|
-
))}
|
|
112
|
-
</tbody>
|
|
113
|
-
</table>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function DirTable({
|
|
118
|
-
hotspots,
|
|
119
|
-
sortField,
|
|
120
|
-
sortDirection,
|
|
121
|
-
onSort,
|
|
122
|
-
}: {
|
|
123
|
-
hotspots: DirectoryHotspot[];
|
|
124
|
-
sortField: SortField;
|
|
125
|
-
sortDirection: SortDirection;
|
|
126
|
-
onSort: (field: SortField) => void;
|
|
127
|
-
}) {
|
|
128
|
-
const sorted = useMemo(() => {
|
|
129
|
-
const items = [...hotspots];
|
|
130
|
-
items.sort((a, b) => {
|
|
131
|
-
// Map file-centric fields to directory equivalents
|
|
132
|
-
const fieldMap: Record<string, keyof DirectoryHotspot> = {
|
|
133
|
-
change_count: 'total_changes',
|
|
134
|
-
bug_fix_count: 'total_bug_fixes',
|
|
135
|
-
author_count: 'avg_author_count',
|
|
136
|
-
churn: 'file_count',
|
|
137
|
-
};
|
|
138
|
-
const key = (fieldMap[sortField] || sortField) as keyof DirectoryHotspot;
|
|
139
|
-
const aVal = a[key];
|
|
140
|
-
const bVal = b[key];
|
|
141
|
-
if (typeof aVal === 'number' && typeof bVal === 'number') {
|
|
142
|
-
return sortDirection === 'desc' ? bVal - aVal : aVal - bVal;
|
|
143
|
-
}
|
|
144
|
-
return sortDirection === 'desc'
|
|
145
|
-
? String(bVal).localeCompare(String(aVal))
|
|
146
|
-
: String(aVal).localeCompare(String(bVal));
|
|
147
|
-
});
|
|
148
|
-
return items;
|
|
149
|
-
}, [hotspots, sortField, sortDirection]);
|
|
150
|
-
|
|
151
|
-
return (
|
|
152
|
-
<table className="hotspots-table" role="table">
|
|
153
|
-
<thead>
|
|
154
|
-
<tr>
|
|
155
|
-
<SortableHeader label="Score" field="hotspot_score" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
156
|
-
<SortableHeader label="Changes" field="change_count" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
157
|
-
<SortableHeader label="Fixes" field="bug_fix_count" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
158
|
-
<SortableHeader label="Authors" field="author_count" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
159
|
-
<SortableHeader label="Files" field="churn" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
160
|
-
<SortableHeader label="Directory" field="path" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} align="left" />
|
|
161
|
-
</tr>
|
|
162
|
-
</thead>
|
|
163
|
-
<tbody>
|
|
164
|
-
{sorted.map((d) => (
|
|
165
|
-
<tr key={d.path}>
|
|
166
|
-
<td className="text-right">
|
|
167
|
-
<Badge variant={d.hotspot_score >= 50 ? 'destructive' : d.hotspot_score >= 25 ? 'outline' : 'secondary'}>
|
|
168
|
-
{d.hotspot_score.toFixed(1)}
|
|
169
|
-
</Badge>
|
|
170
|
-
</td>
|
|
171
|
-
<td className="text-right">{d.total_changes}</td>
|
|
172
|
-
<td className="text-right">{d.total_bug_fixes}</td>
|
|
173
|
-
<td className="text-right">{d.avg_author_count.toFixed(1)}</td>
|
|
174
|
-
<td className="text-right">{d.file_count}</td>
|
|
175
|
-
<td className="text-left">
|
|
176
|
-
<Tooltip>
|
|
177
|
-
<TooltipTrigger asChild>
|
|
178
|
-
<span className="hotspots-filepath">{d.path}</span>
|
|
179
|
-
</TooltipTrigger>
|
|
180
|
-
<TooltipContent>{d.path}</TooltipContent>
|
|
181
|
-
</Tooltip>
|
|
182
|
-
</td>
|
|
183
|
-
</tr>
|
|
184
|
-
))}
|
|
185
|
-
</tbody>
|
|
186
|
-
</table>
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export function HotspotsPanel(): React.ReactElement {
|
|
191
|
-
const [days, setDays] = useState<number>(90);
|
|
192
|
-
const [viewMode, setViewMode] = useState<ViewMode>('files');
|
|
193
|
-
const [sortField, setSortField] = useState<SortField>('hotspot_score');
|
|
194
|
-
const [sortDirection, setSortDirection] = useState<SortDirection>('desc');
|
|
195
|
-
|
|
196
|
-
const { data, isLoading, error, refresh } = useHotspots({ days });
|
|
197
|
-
|
|
198
|
-
const handleSort = useCallback((field: SortField) => {
|
|
199
|
-
setSortField((prev) => {
|
|
200
|
-
if (prev === field) {
|
|
201
|
-
setSortDirection((d) => (d === 'desc' ? 'asc' : 'desc'));
|
|
202
|
-
return prev;
|
|
203
|
-
}
|
|
204
|
-
setSortDirection('desc');
|
|
205
|
-
return field;
|
|
206
|
-
});
|
|
207
|
-
}, []);
|
|
208
|
-
|
|
209
|
-
// Flatten results — single-repo returns fields directly, multi-repo has repo_results
|
|
210
|
-
const repoResults: HotspotRepoResult[] = useMemo(() => {
|
|
211
|
-
if (!data) return [];
|
|
212
|
-
if (data.repo_results) return data.repo_results;
|
|
213
|
-
// Single-repo result — wrap in array
|
|
214
|
-
if (data.file_hotspots) {
|
|
215
|
-
return [{
|
|
216
|
-
success: data.success,
|
|
217
|
-
repo_name: data.repo_name || '',
|
|
218
|
-
repo_path: data.repo_path || '',
|
|
219
|
-
time_window_days: data.time_window_days || days,
|
|
220
|
-
commit_count: data.commit_count || 0,
|
|
221
|
-
file_hotspots: data.file_hotspots || [],
|
|
222
|
-
directory_hotspots: data.directory_hotspots || [],
|
|
223
|
-
}];
|
|
224
|
-
}
|
|
225
|
-
return [];
|
|
226
|
-
}, [data, days]);
|
|
227
|
-
|
|
228
|
-
// Merge all file/dir hotspots across repos
|
|
229
|
-
const allFiles = useMemo(() => {
|
|
230
|
-
const files: FileHotspot[] = [];
|
|
231
|
-
for (const r of repoResults) {
|
|
232
|
-
if (r.success) files.push(...r.file_hotspots);
|
|
233
|
-
}
|
|
234
|
-
return files;
|
|
235
|
-
}, [repoResults]);
|
|
236
|
-
|
|
237
|
-
const allDirs = useMemo(() => {
|
|
238
|
-
const dirs: DirectoryHotspot[] = [];
|
|
239
|
-
for (const r of repoResults) {
|
|
240
|
-
if (r.success) dirs.push(...r.directory_hotspots);
|
|
241
|
-
}
|
|
242
|
-
return dirs;
|
|
243
|
-
}, [repoResults]);
|
|
244
|
-
|
|
245
|
-
const totalCommits = repoResults.reduce((sum, r) => sum + (r.commit_count || 0), 0);
|
|
246
|
-
|
|
247
|
-
// Loading state
|
|
248
|
-
if (isLoading) {
|
|
249
|
-
return (
|
|
250
|
-
<div className="hotspots-panel loading" data-testid="hotspots-panel">
|
|
251
|
-
<div className="space-y-3 p-2">
|
|
252
|
-
<Skeleton className="h-4 w-40" />
|
|
253
|
-
<Skeleton className="h-3 w-full" />
|
|
254
|
-
<Skeleton className="h-3 w-full" />
|
|
255
|
-
<Skeleton className="h-3 w-3/4" />
|
|
256
|
-
<Skeleton className="h-3 w-full" />
|
|
257
|
-
<Skeleton className="h-3 w-5/6" />
|
|
258
|
-
</div>
|
|
259
|
-
</div>
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
// Error state
|
|
264
|
-
if (error) {
|
|
265
|
-
return (
|
|
266
|
-
<div className="hotspots-panel error" data-testid="hotspots-panel">
|
|
267
|
-
<div className="error-message">{error.message}</div>
|
|
268
|
-
<Button variant="outline" size="sm" onClick={refresh}>Retry</Button>
|
|
269
|
-
</div>
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return (
|
|
274
|
-
<TooltipProvider delayDuration={300}>
|
|
275
|
-
<div className="hotspots-panel" data-testid="hotspots-panel">
|
|
276
|
-
{/* Controls bar */}
|
|
277
|
-
<div className="hotspots-controls">
|
|
278
|
-
<div className="hotspots-time-windows">
|
|
279
|
-
{TIME_WINDOWS.map((w) => (
|
|
280
|
-
<Button
|
|
281
|
-
key={w}
|
|
282
|
-
variant={days === w ? 'default' : 'outline'}
|
|
283
|
-
size="sm"
|
|
284
|
-
onClick={() => setDays(w)}
|
|
285
|
-
>
|
|
286
|
-
{w}d
|
|
287
|
-
</Button>
|
|
288
|
-
))}
|
|
289
|
-
</div>
|
|
290
|
-
|
|
291
|
-
<div className="hotspots-view-toggle">
|
|
292
|
-
<Button
|
|
293
|
-
variant={viewMode === 'files' ? 'default' : 'outline'}
|
|
294
|
-
size="sm"
|
|
295
|
-
onClick={() => setViewMode('files')}
|
|
296
|
-
>
|
|
297
|
-
Files
|
|
298
|
-
</Button>
|
|
299
|
-
<Button
|
|
300
|
-
variant={viewMode === 'dirs' ? 'default' : 'outline'}
|
|
301
|
-
size="sm"
|
|
302
|
-
onClick={() => setViewMode('dirs')}
|
|
303
|
-
>
|
|
304
|
-
Dirs
|
|
305
|
-
</Button>
|
|
306
|
-
</div>
|
|
307
|
-
|
|
308
|
-
<Tooltip>
|
|
309
|
-
<TooltipTrigger asChild>
|
|
310
|
-
<Button variant="outline" size="sm" onClick={refresh}>
|
|
311
|
-
Analyze
|
|
312
|
-
</Button>
|
|
313
|
-
</TooltipTrigger>
|
|
314
|
-
<TooltipContent>Run hotspot analysis</TooltipContent>
|
|
315
|
-
</Tooltip>
|
|
316
|
-
</div>
|
|
317
|
-
|
|
318
|
-
{/* Summary */}
|
|
319
|
-
{data && (
|
|
320
|
-
<div className="hotspots-summary">
|
|
321
|
-
<span>{totalCommits} commits</span>
|
|
322
|
-
<span>{allFiles.length} files</span>
|
|
323
|
-
<span>{allDirs.length} dirs</span>
|
|
324
|
-
</div>
|
|
325
|
-
)}
|
|
326
|
-
|
|
327
|
-
{/* No data state */}
|
|
328
|
-
{!data && (
|
|
329
|
-
<div className="hotspots-empty">
|
|
330
|
-
<p>Click <strong>Analyze</strong> to detect code hotspots</p>
|
|
331
|
-
</div>
|
|
332
|
-
)}
|
|
333
|
-
|
|
334
|
-
{/* Table */}
|
|
335
|
-
{data && viewMode === 'files' && (
|
|
336
|
-
allFiles.length > 0 ? (
|
|
337
|
-
<FileTable
|
|
338
|
-
hotspots={allFiles.slice(0, 50)}
|
|
339
|
-
sortField={sortField}
|
|
340
|
-
sortDirection={sortDirection}
|
|
341
|
-
onSort={handleSort}
|
|
342
|
-
/>
|
|
343
|
-
) : (
|
|
344
|
-
<div className="hotspots-empty">No file hotspots found</div>
|
|
345
|
-
)
|
|
346
|
-
)}
|
|
347
|
-
|
|
348
|
-
{data && viewMode === 'dirs' && (
|
|
349
|
-
allDirs.length > 0 ? (
|
|
350
|
-
<DirTable
|
|
351
|
-
hotspots={allDirs.slice(0, 50)}
|
|
352
|
-
sortField={sortField}
|
|
353
|
-
sortDirection={sortDirection}
|
|
354
|
-
onSort={handleSort}
|
|
355
|
-
/>
|
|
356
|
-
) : (
|
|
357
|
-
<div className="hotspots-empty">No directory hotspots found</div>
|
|
358
|
-
)
|
|
359
|
-
)}
|
|
360
|
-
</div>
|
|
361
|
-
</TooltipProvider>
|
|
362
|
-
);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
export default HotspotsPanel;
|