@bevel-software/platform-core-frontend 0.4.1 → 0.5.1
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/THIRD-PARTY-NOTICES.md +5366 -0
- package/package.json +7 -4
- package/src/core/CoreAppShell.tsx +195 -56
- package/src/core/__tests__/AppChrome.test.tsx +125 -0
- package/src/core/__tests__/ShellRoutes.test.tsx +37 -2
- package/src/core/__tests__/bootstrap.test.ts +63 -0
- package/src/core/bootstrap.ts +73 -0
- package/src/core/events.ts +12 -0
- package/src/core/registry.ts +58 -9
- package/src/index.css +100 -11
- package/src/index.ts +24 -23
- package/src/lib/utils.ts +93 -117
- package/src/modules/access/__tests__/ManageAccessDialog.placement.test.tsx +281 -0
- package/src/modules/access/__tests__/ManageAccessDialog.test.tsx +166 -1
- package/src/modules/access/api.ts +49 -0
- package/src/modules/access/components/ManageAccessDialog.tsx +786 -481
- package/src/modules/access/hooks/useFileAccess.ts +1 -1
- package/src/modules/admin/__tests__/AdminRolesPage.suggest.test.tsx +86 -0
- package/src/modules/admin/__tests__/UserAccountsPage.test.tsx +17 -1
- package/src/modules/admin/__tests__/admin.unread.test.tsx +61 -0
- package/src/modules/admin/components/AdminRolesPage.tsx +44 -38
- package/src/modules/admin/components/RolesCorruptedBanner.tsx +11 -10
- package/src/modules/admin/components/UserAccountsPage.tsx +36 -28
- package/src/modules/admin/state/admin.context.tsx +15 -6
- package/src/modules/auth/components/AccountPage.tsx +11 -11
- package/src/modules/auth/components/LoginScreen.tsx +12 -12
- package/src/modules/auth/services/sso.ts +47 -1
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.test.tsx +277 -0
- package/src/modules/change-requests/__tests__/author.test.ts +48 -0
- package/src/modules/change-requests/__tests__/conflict.test.ts +73 -0
- package/src/modules/change-requests/__tests__/diff.test.ts +134 -0
- package/src/modules/change-requests/__tests__/propose.test.ts +93 -0
- package/src/modules/change-requests/__tests__/useFileOnBranch.test.tsx +72 -0
- package/src/modules/change-requests/change-requests.css +22 -0
- package/src/modules/change-requests/components/ChangeBox.tsx +277 -0
- package/src/modules/change-requests/components/ChangeRequestDialog.tsx +713 -0
- package/src/modules/change-requests/components/ConflictHelp.tsx +47 -0
- package/src/modules/change-requests/components/CrFileTree.tsx +398 -0
- package/src/modules/change-requests/components/FileChangeBoxes.tsx +168 -0
- package/src/modules/change-requests/hooks/useApplyChangeRequest.ts +236 -0
- package/src/modules/change-requests/hooks/useCrFileDiffs.ts +79 -0
- package/src/modules/change-requests/hooks/useFileOnBranch.ts +80 -0
- package/src/modules/change-requests/services/change-requests.api.ts +45 -0
- package/src/modules/change-requests/services/propose.api.ts +162 -0
- package/src/modules/change-requests/utils/author.ts +47 -0
- package/src/modules/change-requests/utils/conflict.ts +38 -0
- package/src/modules/change-requests/utils/diff.ts +80 -0
- package/src/modules/git/__tests__/BranchSwitcher.test.tsx +27 -18
- package/src/modules/git/__tests__/FileHistoryPanel.test.tsx +36 -83
- package/src/modules/git/__tests__/PullNeededBanner.test.tsx +5 -5
- package/src/modules/git/__tests__/PullRequestsForMe.test.tsx +147 -0
- package/src/modules/git/__tests__/useAutoPullUpdates.test.tsx +2 -8
- package/src/modules/git/components/BranchSwitcher.tsx +68 -31
- package/src/modules/git/components/DiffView.tsx +4 -4
- package/src/modules/git/components/FileComparisonPanel.tsx +20 -20
- package/src/modules/git/components/FileHistoryPanel.tsx +71 -107
- package/src/modules/git/components/PullNeededBanner.tsx +6 -13
- package/src/modules/git/components/PullRequestsForMe.tsx +71 -36
- package/src/modules/git/components/UnifiedDiffView.tsx +4 -4
- package/src/modules/git/hooks/__tests__/useGitState.deleteBranch.test.tsx +2 -2
- package/src/modules/git/hooks/useGitState.ts +15 -14
- package/src/modules/git/services/__tests__/error-messages.test.ts +4 -4
- package/src/modules/git/services/error-messages.ts +7 -7
- package/src/modules/git/services/git.api.ts +17 -11
- package/src/modules/git/services/pr-prompts.ts +2 -2
- package/src/modules/git/state/git.context.ts +10 -1
- package/src/modules/layout/__tests__/SidebarFrameResponsive.test.tsx +224 -0
- package/src/modules/layout/__tests__/SidebarToggle.test.tsx +242 -0
- package/src/modules/layout/__tests__/breakpoints.test.ts +56 -0
- package/src/modules/layout/breakpoints.ts +6 -0
- package/src/modules/layout/components/AppLayout.tsx +17 -5
- package/src/modules/layout/components/DemoBanner.tsx +10 -1
- package/src/modules/layout/components/MaintenanceOverlay.tsx +3 -3
- package/src/modules/layout/components/MobileChatLayout.tsx +31 -26
- package/src/modules/layout/components/ResizableThreePaneLayout.tsx +59 -24
- package/src/modules/layout/components/SidebarFrame.tsx +317 -0
- package/src/modules/layout/components/SidebarToggle.tsx +86 -0
- package/src/modules/layout/components/SlideOverlay.tsx +1 -1
- package/src/modules/layout/components/__tests__/MobileChatLayout.test.tsx +40 -2
- package/src/modules/layout/components/__tests__/ResizableThreePaneLayout.test.tsx +19 -3
- package/src/modules/layout/state/sidebar.ts +200 -0
- package/src/modules/library/__tests__/AddToGroupDialog.test.tsx +313 -0
- package/src/modules/library/__tests__/ChangeRequestDock.test.tsx +84 -0
- package/src/modules/library/__tests__/GroupJoinRequests.test.tsx +178 -0
- package/src/modules/library/__tests__/GroupPage.test.tsx +479 -0
- package/src/modules/library/__tests__/GroupsIndexPage.test.tsx +283 -0
- package/src/modules/library/__tests__/GroupsSidebar.contextmenu.test.tsx +175 -0
- package/src/modules/library/__tests__/GroupsSidebar.locked.test.tsx +96 -0
- package/src/modules/library/__tests__/GroupsSidebar.test.tsx +142 -0
- package/src/modules/library/__tests__/GroupsSidebarMenu.test.tsx +142 -0
- package/src/modules/library/__tests__/LibraryCard.test.tsx +149 -0
- package/src/modules/library/__tests__/LibraryRoutes.test.tsx +378 -0
- package/src/modules/library/__tests__/LibrarySidebarMenu.test.tsx +347 -0
- package/src/modules/library/__tests__/LockedGroupView.test.tsx +203 -0
- package/src/modules/library/__tests__/NewGroupDialog.test.tsx +114 -0
- package/src/modules/library/__tests__/PersonalAddDialog.test.tsx +177 -0
- package/src/modules/library/__tests__/SkillPage.test.tsx +1063 -0
- package/src/modules/library/__tests__/ToolConnectionSection.test.tsx +259 -0
- package/src/modules/library/__tests__/ToolLogo.test.tsx +63 -0
- package/src/modules/library/__tests__/ToolPage.test.tsx +315 -0
- package/src/modules/library/__tests__/ToolSharePanel.test.tsx +36 -0
- package/src/modules/library/__tests__/ToolVarRow.test.tsx +260 -0
- package/src/modules/library/__tests__/WorkspaceItemRoute.test.tsx +197 -0
- package/src/modules/library/__tests__/auth-harness.tsx +37 -0
- package/src/modules/library/__tests__/oauth-fragment.test.ts +48 -0
- package/src/modules/library/__tests__/status.test.ts +113 -20
- package/src/modules/library/__tests__/useSkillDetail.test.tsx +102 -0
- package/src/modules/library/__tests__/useToolPage.test.tsx +146 -0
- package/src/modules/library/components/AccessRequestsBanner.tsx +101 -0
- package/src/modules/library/components/AddToGroupDialog.tsx +115 -0
- package/src/modules/library/components/ChangeRequestDock.tsx +52 -28
- package/src/modules/library/components/DeleteGroupDialog.tsx +87 -0
- package/src/modules/library/components/GroupIndexRow.tsx +63 -0
- package/src/modules/library/components/GroupJoinRequests.tsx +56 -0
- package/src/modules/library/components/GroupPage.tsx +373 -0
- package/src/modules/library/components/GroupsIndexPage.tsx +222 -0
- package/src/modules/library/components/GroupsSidebar.tsx +338 -0
- package/src/modules/library/components/GroupsSidebarMenu.tsx +160 -0
- package/src/modules/library/components/LibraryCard.tsx +123 -102
- package/src/modules/library/components/LibraryLayout.tsx +344 -0
- package/src/modules/library/components/LibraryPage.tsx +111 -227
- package/src/modules/library/components/LockGlyph.tsx +31 -0
- package/src/modules/library/components/LockedGroupView.tsx +159 -0
- package/src/modules/library/components/ManagedGroupRequests.tsx +70 -0
- package/src/modules/library/components/NewGroupDialog.tsx +112 -0
- package/src/modules/library/components/NewSkillPanel.tsx +151 -0
- package/src/modules/library/components/PageActions.tsx +156 -0
- package/src/modules/library/components/PendingSkillReview.tsx +63 -0
- package/src/modules/library/components/PersonalAddDialog.tsx +88 -0
- package/src/modules/library/components/PersonalGroupPage.tsx +125 -0
- package/src/modules/library/components/StatusDot.tsx +25 -0
- package/src/modules/library/components/ToolLogo.tsx +171 -0
- package/src/modules/library/components/group-page-parts.tsx +419 -0
- package/src/modules/library/components/skill-page/SkillFileEditor.tsx +134 -0
- package/src/modules/library/components/skill-page/SkillFilePane.tsx +117 -0
- package/src/modules/library/components/skill-page/SkillFileTabs.tsx +112 -0
- package/src/modules/library/components/skill-page/SkillPage.tsx +673 -0
- package/src/modules/library/components/skill-page/tab-ids.ts +33 -0
- package/src/modules/library/components/tool-page/ToolConnectionSection.tsx +175 -0
- package/src/modules/library/components/tool-page/ToolPage.tsx +228 -0
- package/src/modules/library/components/tool-page/ToolSharePanel.tsx +45 -0
- package/src/modules/library/components/tool-page/ToolVarRow.tsx +289 -0
- package/src/modules/library/hooks/useJoinRequests.ts +114 -0
- package/src/modules/library/hooks/useLibraryData.ts +134 -119
- package/src/modules/library/hooks/useSkillDetail.ts +119 -74
- package/src/modules/library/hooks/useToolPage.ts +145 -0
- package/src/modules/library/library.css +33 -245
- package/src/modules/library/routes/LibraryRoutes.tsx +134 -0
- package/src/modules/library/routes/WorkspaceItemRoute.tsx +74 -0
- package/src/modules/library/routes/library-paths.ts +191 -0
- package/src/modules/library/services/groups.api.ts +189 -0
- package/src/modules/library/services/library.api.ts +291 -164
- package/src/modules/library/services/tools.api.ts +60 -0
- package/src/modules/library/state/library-context.ts +22 -0
- package/src/modules/library/state/library-data.tsx +223 -0
- package/src/modules/library/state/toast.context.ts +32 -0
- package/src/modules/library/state/toast.tsx +84 -42
- package/src/modules/library/utils/clipboard.ts +33 -0
- package/src/modules/library/utils/group-summary.ts +68 -0
- package/src/modules/library/utils/names.ts +30 -0
- package/src/modules/library/utils/navigate-external.ts +15 -0
- package/src/modules/library/utils/oauth-fragment.ts +32 -0
- package/src/modules/library/utils/personal-group.ts +36 -0
- package/src/modules/library/utils/status.ts +108 -25
- package/src/modules/library/utils/toast-duration.ts +16 -0
- package/src/modules/onboarding/__tests__/onboarding.test.tsx +533 -0
- package/src/modules/onboarding/agent-clients.ts +48 -0
- package/src/modules/onboarding/components/ConnectAgentPill.tsx +133 -0
- package/src/modules/onboarding/components/RootLanding.tsx +54 -0
- package/src/modules/onboarding/components/WelcomePage.tsx +364 -0
- package/src/modules/onboarding/paths.ts +9 -0
- package/src/modules/onboarding/state/onboarding.ts +191 -0
- package/src/modules/pr/components/OpenChangeRequestDialog.tsx +10 -10
- package/src/modules/pr/services/pr-approvals.api.ts +19 -0
- package/src/modules/pr/services/pr-cancel.api.ts +11 -0
- package/src/modules/review/components/BinaryChangePlaceholder.tsx +3 -3
- package/src/modules/review/components/DiffViewer.tsx +4 -4
- package/src/modules/review/components/MarkdownDiffViewer.tsx +84 -26
- package/src/modules/review/components/ReviewFileRow.tsx +10 -10
- package/src/modules/review/components/ReviewPanel.tsx +49 -17
- package/src/modules/review/components/ReviewPanelSurface.tsx +1 -1
- package/src/modules/review/components/__tests__/MarkdownDiffViewer.test.tsx +122 -0
- package/src/modules/review/hooks/__tests__/useReviewState.test.ts +1 -1
- package/src/modules/secrets-vault/components/ConnectToolsPage.tsx +273 -171
- package/src/modules/secrets-vault/components/SecretsPage.tsx +147 -110
- package/src/modules/secrets-vault/components/ToolSecretsPanel.tsx +109 -92
- package/src/modules/secrets-vault/components/__tests__/SecretsPage.test.tsx +35 -4
- package/src/modules/secrets-vault/services/connect.api.ts +24 -3
- package/src/modules/settings/components/DeploymentPage.tsx +90 -0
- package/src/modules/settings/components/SettingsLayout.tsx +135 -0
- package/src/modules/settings/components/SettingsNav.tsx +114 -0
- package/src/modules/settings/components/__tests__/DeploymentPage.test.tsx +110 -0
- package/src/modules/settings/components/__tests__/SettingsLayout.test.tsx +249 -0
- package/src/modules/settings/settings-nav-items.tsx +166 -0
- package/src/modules/setup/__tests__/setup.test.tsx +540 -0
- package/src/modules/setup/components/SetupGate.tsx +67 -0
- package/src/modules/setup/components/SetupScreen.tsx +573 -0
- package/src/modules/setup/services/setup.api.ts +106 -0
- package/src/modules/setup/utils/git-host.ts +34 -0
- package/src/modules/toolbar/components/AppSwitcher.tsx +38 -15
- package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +50 -50
- package/src/modules/toolbar/components/ProfileMenu.tsx +294 -0
- package/src/modules/toolbar/components/Toolbar.tsx +56 -54
- package/src/modules/toolbar/components/__tests__/AppSwitcher.test.tsx +176 -122
- package/src/modules/toolbar/components/__tests__/Toolbar.test.tsx +252 -77
- package/src/modules/tools/ToolsExplorerPage.tsx +45 -40
- package/src/modules/workspace/__tests__/design-system-parity.test.ts +133 -0
- package/src/modules/workspace/__tests__/testFixtures.ts +2 -0
- package/src/modules/workspace/components/EditorTabs.tsx +82 -50
- package/src/modules/workspace/components/FileExplorer.tsx +413 -189
- package/src/modules/workspace/components/FilePaneCard.tsx +53 -0
- package/src/modules/workspace/components/FileRoute.tsx +89 -84
- package/src/modules/workspace/components/FileViewer.tsx +700 -294
- package/src/modules/workspace/components/KbDocumentShell.tsx +138 -0
- package/src/modules/workspace/components/KbFileRail.tsx +128 -0
- package/src/modules/workspace/components/KbPageHeader.tsx +390 -0
- package/src/modules/workspace/components/__tests__/EditorTabs.test.tsx +87 -3
- package/src/modules/workspace/components/__tests__/FileExplorer.test.tsx +293 -39
- package/src/modules/workspace/components/__tests__/FileRoute.test.tsx +1 -16
- package/src/modules/workspace/components/__tests__/FileViewer.test.tsx +462 -44
- package/src/modules/workspace/components/__tests__/KbDocumentShell.test.tsx +84 -0
- package/src/modules/workspace/components/__tests__/KbFileRail.test.tsx +83 -0
- package/src/modules/workspace/components/__tests__/KbPageHeader.test.tsx +192 -0
- package/src/modules/workspace/components/renderers/CopyAnchorButton.tsx +64 -0
- package/src/modules/workspace/components/renderers/CsvRenderer.tsx +8 -8
- package/src/modules/workspace/components/renderers/DocxRenderer.tsx +18 -9
- package/src/modules/workspace/components/renderers/HtmlRenderer.tsx +14 -14
- package/src/modules/workspace/components/renderers/ImageRenderer.tsx +2 -2
- package/src/modules/workspace/components/renderers/KbMarkdownView.tsx +31 -165
- package/src/modules/workspace/components/renderers/MarkdownRenderer.tsx +18 -5
- package/src/modules/workspace/components/renderers/MermaidDiagram.tsx +27 -10
- package/src/modules/workspace/components/renderers/PdfRenderer.tsx +2 -2
- package/src/modules/workspace/components/renderers/TextRenderer.tsx +11 -5
- package/src/modules/workspace/components/renderers/ToolForm.tsx +24 -24
- package/src/modules/workspace/components/renderers/ToolRenderer.tsx +27 -27
- package/src/modules/workspace/components/renderers/XlsxRenderer.tsx +11 -11
- package/src/modules/workspace/components/renderers/__tests__/DocxRenderer.test.tsx +66 -0
- package/src/modules/workspace/components/renderers/__tests__/KbMarkdownView.test.tsx +17 -1
- package/src/modules/workspace/components/renderers/__tests__/MarkdownRenderer.test.tsx +1 -1
- package/src/modules/workspace/components/renderers/__tests__/MermaidDiagram.test.tsx +58 -0
- package/src/modules/workspace/components/renderers/__tests__/lazyRenderer.test.tsx +68 -0
- package/src/modules/workspace/components/renderers/__tests__/rendererLayout.test.ts +64 -0
- package/src/modules/workspace/components/renderers/__tests__/sanitizeDocxHtml.test.ts +0 -0
- package/src/modules/workspace/components/renderers/chunk-boundary.tsx +71 -0
- package/src/modules/workspace/components/renderers/index.ts +78 -2
- package/src/modules/workspace/components/renderers/kbMarkdownPipeline.tsx +241 -0
- package/src/modules/workspace/components/renderers/lazyRenderer.tsx +59 -0
- package/src/modules/workspace/components/renderers/sanitizeDocxHtml.ts +91 -0
- package/src/modules/workspace/hooks/__tests__/useLinksOut.test.ts +59 -0
- package/src/modules/workspace/hooks/__tests__/useOpenChangeRequests.test.tsx +237 -0
- package/src/modules/workspace/hooks/__tests__/useWorkspaceState.test.tsx +185 -0
- package/src/modules/workspace/hooks/useAutoGrowTextarea.ts +30 -0
- package/src/modules/workspace/hooks/useLastCommit.ts +66 -0
- package/src/modules/workspace/hooks/useLinksOut.ts +56 -0
- package/src/modules/workspace/hooks/useOpenChangeRequests.ts +20 -0
- package/src/modules/workspace/hooks/useWorkspaceState.ts +123 -14
- package/src/modules/workspace/routing/__tests__/kb-routes.test.tsx +1 -1
- package/src/modules/workspace/services/workspace.api.ts +9 -2
- package/src/modules/workspace/state/open-change-requests.context.ts +35 -0
- package/src/modules/workspace/state/open-change-requests.tsx +185 -0
- package/src/modules/workspace/state/workspace.context.ts +9 -0
- package/src/modules/workspace/utils/__tests__/diff.test.ts +87 -0
- package/src/modules/workspace/utils/diff.ts +130 -53
- package/src/modules/workspace/utils/fileTree.ts +7 -4
- package/src/modules/workspace/workspace.css +28 -0
- package/src/shared/components/Badge.tsx +62 -0
- package/src/shared/components/Banner.tsx +58 -0
- package/src/shared/components/Button.tsx +90 -0
- package/src/shared/components/Dialog.tsx +6 -6
- package/src/shared/components/Field.tsx +45 -0
- package/src/shared/components/IconButton.tsx +74 -0
- package/src/shared/components/ListRow.tsx +96 -0
- package/src/shared/components/Menu.tsx +88 -0
- package/src/shared/components/PageShell.tsx +8 -5
- package/src/shared/components/Surface.tsx +86 -0
- package/src/shared/components/__tests__/primitives.test.tsx +333 -0
- package/src/shared/components/index.ts +48 -0
- package/src/shared/components/useDismissableMenu.ts +71 -0
- package/src/shared/theme/__tests__/accent-contrast.test.ts +84 -0
- package/src/shared/theme/index.css +12 -0
- package/src/shared/theme/measure.ts +64 -0
- package/src/shared/theme/shadows.css +34 -0
- package/src/shared/theme/tokens.css +193 -0
- package/src/test-setup.ts +9 -0
- package/src/modules/access/components/AccessRestrictedBanner.tsx +0 -31
- package/src/modules/access/components/NodeOwnersBanner.tsx +0 -30
- package/src/modules/git/__tests__/ProtectedBranchBanner.test.tsx +0 -82
- package/src/modules/git/components/ProtectedBranchBanner.tsx +0 -42
- package/src/modules/library/__tests__/DetailDialog.test.tsx +0 -200
- package/src/modules/library/__tests__/diff.test.ts +0 -62
- package/src/modules/library/__tests__/loadout.test.tsx +0 -72
- package/src/modules/library/components/CompareView.tsx +0 -357
- package/src/modules/library/components/DetailDialog.tsx +0 -566
- package/src/modules/library/components/GearIcon.tsx +0 -12
- package/src/modules/library/components/LoadoutSidebar.tsx +0 -156
- package/src/modules/library/components/StatusGem.tsx +0 -21
- package/src/modules/library/components/SuggestChange.tsx +0 -171
- package/src/modules/library/components/particles.ts +0 -50
- package/src/modules/library/state/loadout.tsx +0 -129
- package/src/modules/library/utils/diff.ts +0 -102
- package/src/modules/pr/__tests__/PrApprovalBadge.test.tsx +0 -93
- package/src/modules/pr/__tests__/PrCancelButton.test.tsx +0 -158
- package/src/modules/pr/__tests__/PrCancelConfirmDialog.test.tsx +0 -44
- package/src/modules/pr/__tests__/PrMergeButton.test.tsx +0 -360
- package/src/modules/pr/__tests__/bucketize-comments.test.ts +0 -85
- package/src/modules/pr/__tests__/parsePatch.test.ts +0 -104
- package/src/modules/pr/__tests__/usePrViewerState.test.ts +0 -72
- package/src/modules/pr/components/PrApprovalBadge.tsx +0 -80
- package/src/modules/pr/components/PrCancelButton.tsx +0 -99
- package/src/modules/pr/components/PrCancelConfirmDialog.tsx +0 -119
- package/src/modules/pr/components/PrCommentComposer.tsx +0 -92
- package/src/modules/pr/components/PrCommentThread.tsx +0 -168
- package/src/modules/pr/components/PrCommentsPanel.tsx +0 -143
- package/src/modules/pr/components/PrDiffPane.tsx +0 -425
- package/src/modules/pr/components/PrFileRow.tsx +0 -164
- package/src/modules/pr/components/PrFilesList.tsx +0 -53
- package/src/modules/pr/components/PrHeader.tsx +0 -45
- package/src/modules/pr/components/PrHeaderOverflowMenu.tsx +0 -58
- package/src/modules/pr/components/PrMergeButton.tsx +0 -268
- package/src/modules/pr/components/PrMergeConfirmDialog.tsx +0 -112
- package/src/modules/pr/components/PrRefreshFromTargetButton.tsx +0 -110
- package/src/modules/pr/components/PrViewer.tsx +0 -364
- package/src/modules/pr/hooks/usePrViewerState.ts +0 -150
- package/src/modules/pr/state/pr-viewer.context.ts +0 -34
- package/src/modules/pr/utils/bucketize-comments.ts +0 -55
- package/src/modules/pr/utils/parsePatch.ts +0 -57
- package/src/modules/toolbar/components/AdminMenu.tsx +0 -271
|
@@ -32,18 +32,36 @@ function slugifyDraftName(email: string, text: string): string {
|
|
|
32
32
|
/**
|
|
33
33
|
* Place the branch dropdown just below its trigger. Coordinates are
|
|
34
34
|
* viewport-fixed because the panel is portaled to <body> (so the toolbar's
|
|
35
|
-
* mobile `overflow` row can't clip it).
|
|
36
|
-
*
|
|
35
|
+
* mobile `overflow` row can't clip it).
|
|
36
|
+
*
|
|
37
|
+
* The width is returned alongside the coordinates rather than fixed in the
|
|
38
|
+
* class list: on a phone narrower than the preferred 400px, clamping `left`
|
|
39
|
+
* alone would still push the right edge off screen, so the panel shrinks to
|
|
40
|
+
* whatever the viewport leaves between the two margins and `left` is clamped
|
|
41
|
+
* against that same width.
|
|
37
42
|
*/
|
|
38
|
-
function computePanelPosition(triggerRect: DOMRect): {
|
|
39
|
-
|
|
43
|
+
function computePanelPosition(triggerRect: DOMRect): {
|
|
44
|
+
top: number;
|
|
45
|
+
left: number;
|
|
46
|
+
width: number;
|
|
47
|
+
} {
|
|
48
|
+
const PREFERRED_WIDTH = 400;
|
|
40
49
|
const MARGIN = 8; // min gap kept from the viewport edge
|
|
41
50
|
const GAP = 4; // vertical gap below the trigger (matches the old top-8)
|
|
42
|
-
const
|
|
51
|
+
const width = Math.min(PREFERRED_WIDTH, window.innerWidth - MARGIN * 2);
|
|
52
|
+
const maxLeft = window.innerWidth - width - MARGIN;
|
|
43
53
|
const left = Math.max(MARGIN, Math.min(triggerRect.left, maxLeft));
|
|
44
|
-
return { top: triggerRect.bottom + GAP, left };
|
|
54
|
+
return { top: triggerRect.bottom + GAP, left, width };
|
|
45
55
|
}
|
|
46
56
|
|
|
57
|
+
/**
|
|
58
|
+
* The toolbar's branch picker: which shared draft you are on, and every way to
|
|
59
|
+
* leave it — switch, create, propose as a change request, delete.
|
|
60
|
+
*
|
|
61
|
+
* An enterprise contribution rather than core furniture, so it arrives through
|
|
62
|
+
* the registry's toolbar-item slot and the core build simply has no branch
|
|
63
|
+
* control.
|
|
64
|
+
*/
|
|
47
65
|
export function BranchSwitcher() {
|
|
48
66
|
const git = useGit();
|
|
49
67
|
const navigate = useNavigate();
|
|
@@ -87,7 +105,9 @@ export function BranchSwitcher() {
|
|
|
87
105
|
// every open. The panel is portaled to `document.body` so the toolbar's mobile
|
|
88
106
|
// second row (`overflow-x-auto`/`overflow-y-hidden`) can't clip it — an inline
|
|
89
107
|
// absolutely-positioned child can't escape an `overflow-x-auto` ancestor.
|
|
90
|
-
const [panelPos, setPanelPos] = useState<
|
|
108
|
+
const [panelPos, setPanelPos] = useState<ReturnType<
|
|
109
|
+
typeof computePanelPosition
|
|
110
|
+
> | null>(null);
|
|
91
111
|
// Derived from URL: branch the route is pointing at. Used to label the
|
|
92
112
|
// picker "Switching to X…" while the per-branch workspace bootstrap is
|
|
93
113
|
// resolving in the background. Under the per-branch workspace model the
|
|
@@ -181,6 +201,7 @@ export function BranchSwitcher() {
|
|
|
181
201
|
// protected branch", which the share flow enforces server-side too.
|
|
182
202
|
const canOpenPr = !!currentBranch && !currentBranch.isProtected;
|
|
183
203
|
|
|
204
|
+
/** Discard a draft, confirming first when the remote ref goes with it. */
|
|
184
205
|
async function doDelete(name: string, hasRemote: boolean) {
|
|
185
206
|
// Two reasons a branch reaches doDelete: (1) it's an orphan with no
|
|
186
207
|
// remote counterpart (PR merged + remote head pruned — tidy-up, no
|
|
@@ -200,6 +221,11 @@ export function BranchSwitcher() {
|
|
|
200
221
|
}
|
|
201
222
|
}
|
|
202
223
|
|
|
224
|
+
/**
|
|
225
|
+
* Move to another branch. Under the per-branch workspace model the URL IS
|
|
226
|
+
* the switch — changing it triggers the bootstrap — so there is no git
|
|
227
|
+
* operation to perform here.
|
|
228
|
+
*/
|
|
203
229
|
function doSwitch(name: string) {
|
|
204
230
|
// No-op when the user clicks the branch they're already on — otherwise a dirty
|
|
205
231
|
// tree would pop the commit-first dialog for a switch that has nothing to do.
|
|
@@ -220,6 +246,11 @@ export function BranchSwitcher() {
|
|
|
220
246
|
navigate(kbFileUrl(name, openFilePath ?? ''));
|
|
221
247
|
}
|
|
222
248
|
|
|
249
|
+
/**
|
|
250
|
+
* Turn the typed "what are you changing?" sentence into a draft branch and
|
|
251
|
+
* navigate onto it. Creating and arriving are one gesture — a draft you
|
|
252
|
+
* cannot see yet would be a branch nobody asked for.
|
|
253
|
+
*/
|
|
223
254
|
async function doCreate() {
|
|
224
255
|
const text = newBranchName.trim();
|
|
225
256
|
if (!text) return;
|
|
@@ -239,6 +270,12 @@ export function BranchSwitcher() {
|
|
|
239
270
|
}
|
|
240
271
|
}
|
|
241
272
|
|
|
273
|
+
/**
|
|
274
|
+
* Propose the current draft against `base`, by handing off to whichever
|
|
275
|
+
* change-request port is registered rather than deciding here what
|
|
276
|
+
* "propose" means — enterprise routes it through the chat agent, core opens
|
|
277
|
+
* the dialog.
|
|
278
|
+
*/
|
|
242
279
|
function doOpenPr(base: string) {
|
|
243
280
|
if (!currentBranch) return;
|
|
244
281
|
// Hand off to the registered change-request port. The enterprise registry
|
|
@@ -294,7 +331,7 @@ export function BranchSwitcher() {
|
|
|
294
331
|
}
|
|
295
332
|
setError(null);
|
|
296
333
|
}}
|
|
297
|
-
className="flex items-center gap-1.5 px-2 py-1 text-xs rounded hover:bg-
|
|
334
|
+
className="flex items-center gap-1.5 px-2 py-1 text-xs rounded hover:bg-hover text-ink disabled:opacity-60 disabled:cursor-not-allowed"
|
|
298
335
|
title={branchLabel}
|
|
299
336
|
// Stay clickable mid-switch so the user can re-pick a branch — the
|
|
300
337
|
// switch is just URL navigation and re-navigating cancels cleanly.
|
|
@@ -303,7 +340,7 @@ export function BranchSwitcher() {
|
|
|
303
340
|
disabled={git.availability === 'loading' && !git.status}
|
|
304
341
|
>
|
|
305
342
|
{switchingTo ? (
|
|
306
|
-
<Loader2 size={13} className="animate-spin text-
|
|
343
|
+
<Loader2 size={13} className="animate-spin text-ink-muted" />
|
|
307
344
|
) : (
|
|
308
345
|
<GitBranch size={13} />
|
|
309
346
|
)}
|
|
@@ -316,27 +353,27 @@ export function BranchSwitcher() {
|
|
|
316
353
|
{open && panelPos && createPortal(
|
|
317
354
|
<div
|
|
318
355
|
ref={panelRef}
|
|
319
|
-
className="fixed z-50
|
|
320
|
-
style={{ top: panelPos.top, left: panelPos.left }}
|
|
356
|
+
className="fixed z-50 bg-sunken border border-line-strong rounded-lg shadow-xl overflow-hidden"
|
|
357
|
+
style={{ top: panelPos.top, left: panelPos.left, width: panelPos.width }}
|
|
321
358
|
>
|
|
322
359
|
{!creating && !choosingTarget && (
|
|
323
360
|
<>
|
|
324
361
|
<button
|
|
325
|
-
className="flex items-center gap-2 w-full text-left px-3 py-2 text-sm text-
|
|
362
|
+
className="flex items-center gap-2 w-full text-left px-3 py-2 text-sm text-ink hover:bg-hover"
|
|
326
363
|
onClick={() => setCreating(true)}
|
|
327
364
|
>
|
|
328
365
|
<Plus size={14} />
|
|
329
366
|
Start a shared draft…
|
|
330
367
|
</button>
|
|
331
368
|
<button
|
|
332
|
-
className="flex items-center gap-2 w-full text-left px-3 py-2 text-sm text-
|
|
369
|
+
className="flex items-center gap-2 w-full text-left px-3 py-2 text-sm text-ink hover:bg-hover border-b border-line-strong disabled:opacity-50 disabled:cursor-not-allowed"
|
|
333
370
|
onClick={() => setChoosingTarget(true)}
|
|
334
371
|
disabled={!canOpenPr}
|
|
335
372
|
title={
|
|
336
373
|
!currentBranch
|
|
337
374
|
? 'No draft selected'
|
|
338
375
|
: currentBranch.isProtected
|
|
339
|
-
? "You can't propose changes from an official version
|
|
376
|
+
? "You can't propose changes from an official version. Switch to a draft first"
|
|
340
377
|
: 'Pick where this change request should land'
|
|
341
378
|
}
|
|
342
379
|
>
|
|
@@ -347,13 +384,13 @@ export function BranchSwitcher() {
|
|
|
347
384
|
)}
|
|
348
385
|
|
|
349
386
|
{choosingTarget && (
|
|
350
|
-
<div className="border-b border-
|
|
387
|
+
<div className="border-b border-line-strong">
|
|
351
388
|
<div className="flex items-center justify-between px-3 pt-2 pb-1">
|
|
352
|
-
<span className="text-[11px] text-
|
|
389
|
+
<span className="text-[11px] text-ink-muted uppercase tracking-wide">
|
|
353
390
|
Apply draft to…
|
|
354
391
|
</span>
|
|
355
392
|
<button
|
|
356
|
-
className="text-[11px] text-
|
|
393
|
+
className="text-[11px] text-ink-muted hover:text-ink"
|
|
357
394
|
onClick={() => setChoosingTarget(false)}
|
|
358
395
|
>
|
|
359
396
|
Cancel
|
|
@@ -361,7 +398,7 @@ export function BranchSwitcher() {
|
|
|
361
398
|
</div>
|
|
362
399
|
<div className="max-h-48 overflow-y-auto">
|
|
363
400
|
{targetBranches.length === 0 && (
|
|
364
|
-
<div className="px-3 py-2 text-xs text-
|
|
401
|
+
<div className="px-3 py-2 text-xs text-ink-muted">
|
|
365
402
|
No other branches to target.
|
|
366
403
|
</div>
|
|
367
404
|
)}
|
|
@@ -378,10 +415,10 @@ export function BranchSwitcher() {
|
|
|
378
415
|
className={`flex items-center gap-2 w-full text-left px-3 py-1.5 text-sm ${
|
|
379
416
|
isDefaultTarget
|
|
380
417
|
? 'bg-emerald-50 text-emerald-700 hover:bg-emerald-100'
|
|
381
|
-
: 'text-
|
|
418
|
+
: 'text-ink hover:bg-hover'
|
|
382
419
|
}`}
|
|
383
420
|
>
|
|
384
|
-
{b.isProtected && <Lock size={11} className="text-
|
|
421
|
+
{b.isProtected && <Lock size={11} className="text-ink-muted" />}
|
|
385
422
|
{displayName ? (
|
|
386
423
|
<span className="truncate flex-1" title={b.name}>
|
|
387
424
|
{displayName}
|
|
@@ -402,8 +439,8 @@ export function BranchSwitcher() {
|
|
|
402
439
|
)}
|
|
403
440
|
|
|
404
441
|
{creating && (
|
|
405
|
-
<div className="px-3 py-2 border-b border-
|
|
406
|
-
<div className="text-[11px] text-
|
|
442
|
+
<div className="px-3 py-2 border-b border-line-strong space-y-2">
|
|
443
|
+
<div className="text-[11px] text-ink-muted">What are you changing?</div>
|
|
407
444
|
<input
|
|
408
445
|
autoFocus
|
|
409
446
|
type="text"
|
|
@@ -417,7 +454,7 @@ export function BranchSwitcher() {
|
|
|
417
454
|
setNewBranchName('');
|
|
418
455
|
}
|
|
419
456
|
}}
|
|
420
|
-
className="w-full bg-white border border-
|
|
457
|
+
className="w-full bg-white border border-line-strong rounded px-2 py-1 text-xs focus:outline-none focus:border-accent"
|
|
421
458
|
/>
|
|
422
459
|
<div className="flex justify-end gap-1">
|
|
423
460
|
<button
|
|
@@ -425,7 +462,7 @@ export function BranchSwitcher() {
|
|
|
425
462
|
setCreating(false);
|
|
426
463
|
setNewBranchName('');
|
|
427
464
|
}}
|
|
428
|
-
className="px-2 py-0.5 text-xs rounded hover:bg-
|
|
465
|
+
className="px-2 py-0.5 text-xs rounded hover:bg-hover text-ink"
|
|
429
466
|
>
|
|
430
467
|
Cancel
|
|
431
468
|
</button>
|
|
@@ -442,7 +479,7 @@ export function BranchSwitcher() {
|
|
|
442
479
|
|
|
443
480
|
<div className="max-h-64 overflow-y-auto">
|
|
444
481
|
{git.branches.length === 0 && (
|
|
445
|
-
<div className="px-3 py-2 text-xs text-
|
|
482
|
+
<div className="px-3 py-2 text-xs text-ink-muted">No drafts yet.</div>
|
|
446
483
|
)}
|
|
447
484
|
{git.branches.map((b) => {
|
|
448
485
|
const current = isCurrentBranch(b);
|
|
@@ -470,14 +507,14 @@ export function BranchSwitcher() {
|
|
|
470
507
|
!b.isProtected && !current && (isOrphan || isAuthoredByMe || isAdmin);
|
|
471
508
|
const deleteTitle = isOrphan
|
|
472
509
|
? 'Delete this draft (no longer shared)'
|
|
473
|
-
: `Delete shared draft "${b.name}"
|
|
510
|
+
: `Delete shared draft "${b.name}": removes it for everyone`;
|
|
474
511
|
return (
|
|
475
512
|
<div
|
|
476
513
|
key={b.name}
|
|
477
514
|
className={`flex items-stretch w-full text-sm group ${
|
|
478
515
|
current
|
|
479
|
-
? 'bg-
|
|
480
|
-
: 'text-
|
|
516
|
+
? 'bg-line-strong text-ink'
|
|
517
|
+
: 'text-ink hover:bg-hover'
|
|
481
518
|
}`}
|
|
482
519
|
>
|
|
483
520
|
<button
|
|
@@ -489,7 +526,7 @@ export function BranchSwitcher() {
|
|
|
489
526
|
}`}
|
|
490
527
|
>
|
|
491
528
|
{current ? <Check size={12} /> : <span className="w-3" />}
|
|
492
|
-
{b.isProtected && <Lock size={11} className="text-
|
|
529
|
+
{b.isProtected && <Lock size={11} className="text-ink-muted" />}
|
|
493
530
|
<span className="truncate flex-1" title={b.name}>{b.name}</span>
|
|
494
531
|
</button>
|
|
495
532
|
{canDelete && (
|
|
@@ -500,7 +537,7 @@ export function BranchSwitcher() {
|
|
|
500
537
|
}}
|
|
501
538
|
title={deleteTitle}
|
|
502
539
|
aria-label={deleteTitle}
|
|
503
|
-
className="px-2 text-
|
|
540
|
+
className="px-2 text-ink-muted hover:text-red-600 hover:bg-hover opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity"
|
|
504
541
|
>
|
|
505
542
|
<Trash2 size={12} />
|
|
506
543
|
</button>
|
|
@@ -513,7 +550,7 @@ export function BranchSwitcher() {
|
|
|
513
550
|
{error && (
|
|
514
551
|
<div
|
|
515
552
|
role="alert"
|
|
516
|
-
className="px-3 py-2 text-xs text-red-600 border-t border-
|
|
553
|
+
className="px-3 py-2 text-xs text-red-600 border-t border-line-strong"
|
|
517
554
|
>
|
|
518
555
|
{error.message}
|
|
519
556
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export function DiffView({ diff }: { diff: string }) {
|
|
2
2
|
if (!diff.trim()) {
|
|
3
3
|
return (
|
|
4
|
-
<div className="px-3 py-3 text-xs text-
|
|
4
|
+
<div className="px-3 py-3 text-xs text-ink-muted">
|
|
5
5
|
No file changes in this save.
|
|
6
6
|
</div>
|
|
7
7
|
);
|
|
@@ -10,12 +10,12 @@ export function DiffView({ diff }: { diff: string }) {
|
|
|
10
10
|
return (
|
|
11
11
|
<pre className="px-3 py-2 text-xs font-mono leading-5 whitespace-pre">
|
|
12
12
|
{lines.map((line, i) => {
|
|
13
|
-
let cls = 'text-
|
|
14
|
-
if (line.startsWith('+++') || line.startsWith('---')) cls = 'text-
|
|
13
|
+
let cls = 'text-ink';
|
|
14
|
+
if (line.startsWith('+++') || line.startsWith('---')) cls = 'text-ink-muted';
|
|
15
15
|
else if (line.startsWith('@@')) cls = 'text-sky-600';
|
|
16
16
|
else if (line.startsWith('+')) cls = 'text-emerald-700 bg-emerald-50';
|
|
17
17
|
else if (line.startsWith('-')) cls = 'text-red-700 bg-red-50';
|
|
18
|
-
else if (line.startsWith('diff ') || line.startsWith('index ')) cls = 'text-
|
|
18
|
+
else if (line.startsWith('diff ') || line.startsWith('index ')) cls = 'text-ink-muted';
|
|
19
19
|
// <pre> expects phrasing content; use a block-displayed <span> so each
|
|
20
20
|
// diff line still takes a full row without violating the HTML content
|
|
21
21
|
// model (div-in-pre triggers hydration warnings in strict mode).
|
|
@@ -211,9 +211,9 @@ export function FileComparisonPanel({ filePath, initialFrom, initialTo, refreshK
|
|
|
211
211
|
|
|
212
212
|
return (
|
|
213
213
|
<div className="flex-1 flex flex-col min-h-0 bg-white">
|
|
214
|
-
<div className="flex items-center gap-2 px-3 py-2 border-b border-
|
|
215
|
-
<GitCompare size={14} className="text-
|
|
216
|
-
<span className="text-xs text-
|
|
214
|
+
<div className="flex items-center gap-2 px-3 py-2 border-b border-line shrink-0">
|
|
215
|
+
<GitCompare size={14} className="text-ink-muted shrink-0" />
|
|
216
|
+
<span className="text-xs text-ink-muted truncate flex-1 min-w-0">
|
|
217
217
|
Compare versions of {filePath}
|
|
218
218
|
</span>
|
|
219
219
|
<button
|
|
@@ -222,13 +222,13 @@ export function FileComparisonPanel({ filePath, initialFrom, initialTo, refreshK
|
|
|
222
222
|
disabled={loading || !fromBranch || !toBranch || fromBranch === toBranch}
|
|
223
223
|
title="Refresh comparison"
|
|
224
224
|
aria-label="Refresh comparison"
|
|
225
|
-
className="p-1 rounded text-
|
|
225
|
+
className="p-1 rounded text-ink-muted hover:text-ink hover:bg-hover disabled:opacity-40 disabled:cursor-not-allowed transition-colors shrink-0"
|
|
226
226
|
>
|
|
227
227
|
<RefreshCw size={12} className={loading ? 'animate-spin' : undefined} />
|
|
228
228
|
</button>
|
|
229
229
|
</div>
|
|
230
230
|
|
|
231
|
-
<div className="flex items-center gap-2 px-3 py-2 border-b border-
|
|
231
|
+
<div className="flex items-center gap-2 px-3 py-2 border-b border-line shrink-0">
|
|
232
232
|
<BranchPicker
|
|
233
233
|
label="From"
|
|
234
234
|
value={fromBranch}
|
|
@@ -241,7 +241,7 @@ export function FileComparisonPanel({ filePath, initialFrom, initialTo, refreshK
|
|
|
241
241
|
disabled={!fromBranch || !toBranch}
|
|
242
242
|
title="Swap From and To"
|
|
243
243
|
aria-label="Swap From and To"
|
|
244
|
-
className="p-1.5 rounded text-
|
|
244
|
+
className="p-1.5 rounded text-ink-muted hover:text-ink hover:bg-hover disabled:opacity-40 disabled:cursor-not-allowed transition-colors"
|
|
245
245
|
>
|
|
246
246
|
<ArrowLeftRight size={14} />
|
|
247
247
|
</button>
|
|
@@ -262,17 +262,17 @@ export function FileComparisonPanel({ filePath, initialFrom, initialTo, refreshK
|
|
|
262
262
|
|
|
263
263
|
<div className="flex-1 overflow-auto">
|
|
264
264
|
{(!fromBranch || !toBranch) && !loading && !error && (
|
|
265
|
-
<div className="flex items-center justify-center h-full px-6 text-xs text-
|
|
265
|
+
<div className="flex items-center justify-center h-full px-6 text-xs text-ink-muted text-center">
|
|
266
266
|
Pick two versions to compare.
|
|
267
267
|
</div>
|
|
268
268
|
)}
|
|
269
269
|
{fromBranch && toBranch && fromBranch === toBranch && !loading && !error && (
|
|
270
|
-
<div className="flex items-center justify-center h-full px-6 text-xs text-
|
|
270
|
+
<div className="flex items-center justify-center h-full px-6 text-xs text-ink-muted text-center">
|
|
271
271
|
Pick two different versions to see what changed.
|
|
272
272
|
</div>
|
|
273
273
|
)}
|
|
274
274
|
{loading && (
|
|
275
|
-
<div className="flex items-center gap-2 px-3 py-3 text-xs text-
|
|
275
|
+
<div className="flex items-center gap-2 px-3 py-3 text-xs text-ink-muted">
|
|
276
276
|
<Loader2 size={13} className="animate-spin" />
|
|
277
277
|
Loading comparison…
|
|
278
278
|
</div>
|
|
@@ -313,32 +313,32 @@ function BranchPicker({ label, value, branches, onChange }: BranchPickerProps) {
|
|
|
313
313
|
const valueIsProtected = !!value && (
|
|
314
314
|
branches.find((b) => b.name === value)?.isProtected ?? false
|
|
315
315
|
);
|
|
316
|
-
const valueDisplay = value ? protectedBranchDisplayName(value) ?? value : '
|
|
316
|
+
const valueDisplay = value ? protectedBranchDisplayName(value) ?? value : 'Select…';
|
|
317
317
|
|
|
318
318
|
return (
|
|
319
319
|
<div ref={ref} className="relative flex-1 min-w-0">
|
|
320
|
-
<div className="text-[10px] uppercase tracking-wide text-
|
|
320
|
+
<div className="text-[10px] uppercase tracking-wide text-ink-muted mb-0.5">
|
|
321
321
|
{label}
|
|
322
322
|
</div>
|
|
323
323
|
<button
|
|
324
324
|
type="button"
|
|
325
325
|
onClick={() => setOpen((v) => !v)}
|
|
326
|
-
className="w-full flex items-center gap-1.5 px-2 py-1.5 text-xs rounded bg-
|
|
326
|
+
className="w-full flex items-center gap-1.5 px-2 py-1.5 text-xs rounded bg-sunken hover:bg-hover border border-line-strong text-ink min-w-0"
|
|
327
327
|
aria-haspopup="listbox"
|
|
328
328
|
aria-expanded={open}
|
|
329
329
|
>
|
|
330
|
-
{valueIsProtected && <Lock size={11} className="text-
|
|
330
|
+
{valueIsProtected && <Lock size={11} className="text-ink-muted shrink-0" />}
|
|
331
331
|
<span className="truncate flex-1 text-left">{valueDisplay}</span>
|
|
332
|
-
<ChevronDown size={12} className={`text-
|
|
332
|
+
<ChevronDown size={12} className={`text-ink-muted transition-transform ${open ? 'rotate-180' : ''}`} />
|
|
333
333
|
</button>
|
|
334
334
|
|
|
335
335
|
{open && (
|
|
336
336
|
<div
|
|
337
337
|
role="listbox"
|
|
338
|
-
className="absolute top-full left-0 right-0 z-40 mt-1 bg-
|
|
338
|
+
className="absolute top-full left-0 right-0 z-40 mt-1 bg-sunken border border-line-strong rounded-lg shadow-xl max-h-64 overflow-y-auto"
|
|
339
339
|
>
|
|
340
340
|
{branches.length === 0 && (
|
|
341
|
-
<div className="px-3 py-2 text-xs text-
|
|
341
|
+
<div className="px-3 py-2 text-xs text-ink-muted">No branches.</div>
|
|
342
342
|
)}
|
|
343
343
|
{branches.map((b) => {
|
|
344
344
|
const display = protectedBranchDisplayName(b.name);
|
|
@@ -354,16 +354,16 @@ function BranchPicker({ label, value, branches, onChange }: BranchPickerProps) {
|
|
|
354
354
|
}}
|
|
355
355
|
className={`flex items-center gap-2 w-full text-left px-3 py-1.5 text-xs ${
|
|
356
356
|
isSelected
|
|
357
|
-
? 'bg-
|
|
358
|
-
: 'text-
|
|
357
|
+
? 'bg-line-strong text-ink'
|
|
358
|
+
: 'text-ink hover:bg-hover'
|
|
359
359
|
}`}
|
|
360
360
|
>
|
|
361
|
-
{b.isProtected && <Lock size={11} className="text-
|
|
361
|
+
{b.isProtected && <Lock size={11} className="text-ink-muted shrink-0" />}
|
|
362
362
|
<span className="truncate flex-1">
|
|
363
363
|
{display ?? <span className="font-mono">{b.name}</span>}
|
|
364
364
|
</span>
|
|
365
365
|
{display && (
|
|
366
|
-
<span className="font-mono text-[10px] text-
|
|
366
|
+
<span className="font-mono text-[10px] text-ink-muted shrink-0 truncate max-w-[40%]">
|
|
367
367
|
{b.name}
|
|
368
368
|
</span>
|
|
369
369
|
)}
|