mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
feat: improve source control setting - add API budget pane and clean up git search (#5512)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -6,8 +6,6 @@ import { useAppStore } from '../../store'
|
||||
import { getGitPaneSearchEntries } from './git-search'
|
||||
import { SearchableSetting } from './SearchableSetting'
|
||||
import { matchesSettingsSearch } from './settings-search'
|
||||
import { GitHubRateLimitPanel } from '../github/github-rate-limit-display'
|
||||
import { GitLabRateLimitPanel } from '../gitlab/gitlab-rate-limit-display'
|
||||
import { AutoRenameBranchFromWorkSetting } from './AutoRenameBranchFromWorkSetting'
|
||||
import { getAutoRenameBranchSearchEntries } from './auto-rename-branch-search'
|
||||
import {
|
||||
@@ -210,59 +208,6 @@ export function GitPane({
|
||||
settingsSearchQuery={searchQuery}
|
||||
/>
|
||||
) : null,
|
||||
matchesSettingsSearch(searchQuery, {
|
||||
title: translate('auto.components.settings.GitPane.612a440e57', 'GitHub API Budget'),
|
||||
description: translate(
|
||||
'auto.components.settings.GitPane.aa204f185f',
|
||||
'Current GitHub CLI REST, Search, and GraphQL rate limits.'
|
||||
),
|
||||
keywords: [
|
||||
translate('auto.components.settings.GitPane.32dca11189', 'github'),
|
||||
translate('auto.components.settings.GitPane.895d3f70b8', 'gh'),
|
||||
translate('auto.components.settings.GitPane.2cde9044a8', 'graphql'),
|
||||
translate('auto.components.settings.GitPane.b9c011fbc2', 'rate limit'),
|
||||
translate('auto.components.settings.GitPane.cdd793134e', 'api budget')
|
||||
]
|
||||
}) ? (
|
||||
<SearchableSetting
|
||||
key="github-api-budget"
|
||||
title={translate('auto.components.settings.GitPane.612a440e57', 'GitHub API Budget')}
|
||||
description={translate(
|
||||
'auto.components.settings.GitPane.aa204f185f',
|
||||
'Current GitHub CLI REST, Search, and GraphQL rate limits.'
|
||||
)}
|
||||
keywords={['github', 'gh', 'graphql', 'rate limit', 'api budget']}
|
||||
className="space-y-3"
|
||||
>
|
||||
<GitHubRateLimitPanel />
|
||||
</SearchableSetting>
|
||||
) : null,
|
||||
matchesSettingsSearch(searchQuery, {
|
||||
title: translate('auto.components.settings.GitPane.0de4ae556c', 'GitLab API Budget'),
|
||||
description: translate(
|
||||
'auto.components.settings.GitPane.c4f610d057',
|
||||
'Current GitLab CLI REST rate-limit headers when available.'
|
||||
),
|
||||
keywords: [
|
||||
translate('auto.components.settings.GitPane.8a527d48e3', 'gitlab'),
|
||||
translate('auto.components.settings.GitPane.3072428ac7', 'glab'),
|
||||
translate('auto.components.settings.GitPane.b9c011fbc2', 'rate limit'),
|
||||
translate('auto.components.settings.GitPane.cdd793134e', 'api budget')
|
||||
]
|
||||
}) ? (
|
||||
<SearchableSetting
|
||||
key="gitlab-api-budget"
|
||||
title={translate('auto.components.settings.GitPane.0de4ae556c', 'GitLab API Budget')}
|
||||
description={translate(
|
||||
'auto.components.settings.GitPane.c4f610d057',
|
||||
'Current GitLab CLI REST rate-limit headers when available.'
|
||||
)}
|
||||
keywords={['gitlab', 'glab', 'rate limit', 'api budget']}
|
||||
className="space-y-3"
|
||||
>
|
||||
<GitLabRateLimitPanel />
|
||||
</SearchableSetting>
|
||||
) : null,
|
||||
matchesSettingsSearch(searchQuery, {
|
||||
title: translate('auto.components.settings.GitPane.e02ea23a32', 'Orca Attribution'),
|
||||
description: translate(
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
import { useAppStore } from '../../store'
|
||||
import { SearchableSetting } from './SearchableSetting'
|
||||
import { matchesSettingsSearch } from './settings-search'
|
||||
import { GitHubRateLimitPanel } from '../github/github-rate-limit-display'
|
||||
import { GitLabRateLimitPanel } from '../gitlab/gitlab-rate-limit-display'
|
||||
import { translate } from '@/i18n/i18n'
|
||||
|
||||
type GitProviderApiBudgetPaneProps = {
|
||||
settingsSearchQuery?: string
|
||||
}
|
||||
|
||||
export function GitProviderApiBudgetPane({
|
||||
settingsSearchQuery
|
||||
}: GitProviderApiBudgetPaneProps): React.JSX.Element | null {
|
||||
const storeSearchQuery = useAppStore((s) => s.settingsSearchQuery)
|
||||
const searchQuery = settingsSearchQuery ?? storeSearchQuery
|
||||
|
||||
const visibleSections = [
|
||||
matchesSettingsSearch(searchQuery, {
|
||||
title: translate('auto.components.settings.GitPane.612a440e57', 'GitHub API Budget'),
|
||||
description: translate(
|
||||
'auto.components.settings.GitPane.aa204f185f',
|
||||
'Current GitHub CLI REST, Search, and GraphQL rate limits.'
|
||||
),
|
||||
keywords: [
|
||||
translate('auto.components.settings.GitPane.32dca11189', 'github'),
|
||||
translate('auto.components.settings.GitPane.895d3f70b8', 'gh'),
|
||||
translate('auto.components.settings.GitPane.2cde9044a8', 'graphql'),
|
||||
translate('auto.components.settings.GitPane.b9c011fbc2', 'rate limit'),
|
||||
translate('auto.components.settings.GitPane.cdd793134e', 'api budget')
|
||||
]
|
||||
}) ? (
|
||||
<SearchableSetting
|
||||
key="github-api-budget"
|
||||
title={translate('auto.components.settings.GitPane.612a440e57', 'GitHub API Budget')}
|
||||
description={translate(
|
||||
'auto.components.settings.GitPane.aa204f185f',
|
||||
'Current GitHub CLI REST, Search, and GraphQL rate limits.'
|
||||
)}
|
||||
keywords={['github', 'gh', 'graphql', 'rate limit', 'api budget']}
|
||||
className="space-y-3"
|
||||
>
|
||||
<GitHubRateLimitPanel />
|
||||
</SearchableSetting>
|
||||
) : null,
|
||||
matchesSettingsSearch(searchQuery, {
|
||||
title: translate('auto.components.settings.GitPane.0de4ae556c', 'GitLab API Budget'),
|
||||
description: translate(
|
||||
'auto.components.settings.GitPane.c4f610d057',
|
||||
'Current GitLab CLI REST rate-limit headers when available.'
|
||||
),
|
||||
keywords: [
|
||||
translate('auto.components.settings.GitPane.8a527d48e3', 'gitlab'),
|
||||
translate('auto.components.settings.GitPane.3072428ac7', 'glab'),
|
||||
translate('auto.components.settings.GitPane.b9c011fbc2', 'rate limit'),
|
||||
translate('auto.components.settings.GitPane.cdd793134e', 'api budget')
|
||||
]
|
||||
}) ? (
|
||||
<SearchableSetting
|
||||
key="gitlab-api-budget"
|
||||
title={translate('auto.components.settings.GitPane.0de4ae556c', 'GitLab API Budget')}
|
||||
description={translate(
|
||||
'auto.components.settings.GitPane.c4f610d057',
|
||||
'Current GitLab CLI REST rate-limit headers when available.'
|
||||
)}
|
||||
keywords={['gitlab', 'glab', 'rate limit', 'api budget']}
|
||||
className="space-y-3"
|
||||
>
|
||||
<GitLabRateLimitPanel />
|
||||
</SearchableSetting>
|
||||
) : null
|
||||
].filter(Boolean)
|
||||
|
||||
if (visibleSections.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
// Why: provider budgets are diagnostic, so they render after core git and AI
|
||||
// settings instead of competing with everyday branch and attribution controls.
|
||||
return <div className="space-y-4 border-t border-border/40 pt-4">{visibleSections}</div>
|
||||
}
|
||||
@@ -28,6 +28,7 @@ import { useWarpThemeImport } from './useWarpThemeImport'
|
||||
import { RepositoryPane } from './RepositoryPane'
|
||||
import { GitPane } from './GitPane'
|
||||
import { CommitMessageAiPane } from './CommitMessageAiPane'
|
||||
import { GitProviderApiBudgetPane } from './GitProviderApiBudgetPane'
|
||||
import { NotificationsPane } from './NotificationsPane'
|
||||
import { VoicePane } from './VoicePane'
|
||||
import { SshPane } from './SshPane'
|
||||
@@ -1172,6 +1173,7 @@ function Settings(): React.JSX.Element {
|
||||
customPromptDiscardSignal={sourceControlAiPromptDiscardSignal}
|
||||
settingsSearchQuery={settingsSearchQuery}
|
||||
/>
|
||||
<GitProviderApiBudgetPane settingsSearchQuery={settingsSearchQuery} />
|
||||
</>
|
||||
) : null}
|
||||
</SettingsSection>
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import { translate } from '@/i18n/i18n'
|
||||
import { translateSearchKeyword } from './settings-search-keywords'
|
||||
import { createLocalizedCatalog } from '@/i18n/localized-catalog'
|
||||
|
||||
export const getGitProviderApiBudgetSearchEntries = createLocalizedCatalog(() => [
|
||||
{
|
||||
title: translate('auto.components.settings.git.search.ff86e354c4', 'GitHub API Budget'),
|
||||
description: translate(
|
||||
'auto.components.settings.git.search.1139f61512',
|
||||
'Current GitHub CLI REST, Search, and GraphQL rate limits.'
|
||||
),
|
||||
keywords: [
|
||||
...translateSearchKeyword('auto.components.settings.git.search.d088806071', 'github'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.16f53f7323', 'gh'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.65b69d9f80', 'graphql'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.b7e52124c7', 'rate limit'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.40f9b815fd', 'api budget')
|
||||
]
|
||||
},
|
||||
{
|
||||
title: translate('auto.components.settings.git.search.83ecb3f470', 'GitLab API Budget'),
|
||||
description: translate(
|
||||
'auto.components.settings.git.search.2b4a72885d',
|
||||
'Current GitLab CLI REST rate-limit headers when available.'
|
||||
),
|
||||
keywords: [
|
||||
...translateSearchKeyword('auto.components.settings.git.search.4808f065b3', 'gitlab'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.ead733645f', 'glab'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.b7e52124c7', 'rate limit'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.40f9b815fd', 'api budget')
|
||||
]
|
||||
}
|
||||
])
|
||||
@@ -44,33 +44,6 @@ export const getGitPaneSearchEntries = createLocalizedCatalog(() => [
|
||||
]
|
||||
},
|
||||
...getAutoRenameBranchSearchEntries(),
|
||||
{
|
||||
title: translate('auto.components.settings.git.search.ff86e354c4', 'GitHub API Budget'),
|
||||
description: translate(
|
||||
'auto.components.settings.git.search.1139f61512',
|
||||
'Current GitHub CLI REST, Search, and GraphQL rate limits.'
|
||||
),
|
||||
keywords: [
|
||||
...translateSearchKeyword('auto.components.settings.git.search.d088806071', 'github'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.16f53f7323', 'gh'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.65b69d9f80', 'graphql'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.b7e52124c7', 'rate limit'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.40f9b815fd', 'api budget')
|
||||
]
|
||||
},
|
||||
{
|
||||
title: translate('auto.components.settings.git.search.83ecb3f470', 'GitLab API Budget'),
|
||||
description: translate(
|
||||
'auto.components.settings.git.search.2b4a72885d',
|
||||
'Current GitLab CLI REST rate-limit headers when available.'
|
||||
),
|
||||
keywords: [
|
||||
...translateSearchKeyword('auto.components.settings.git.search.4808f065b3', 'gitlab'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.ead733645f', 'glab'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.b7e52124c7', 'rate limit'),
|
||||
...translateSearchKeyword('auto.components.settings.git.search.40f9b815fd', 'api budget')
|
||||
]
|
||||
},
|
||||
{
|
||||
title: translate('auto.components.settings.git.search.bc7d9f69ce', 'Orca Attribution'),
|
||||
description: translate(
|
||||
|
||||
@@ -43,6 +43,7 @@ import { getAgentsPaneSearchEntries } from '@/components/settings/agents-search'
|
||||
import { getAccountsPaneSearchEntries } from '@/components/settings/accounts-search'
|
||||
import { getIntegrationsPaneSearchEntries } from '@/components/settings/integrations-search'
|
||||
import { getGitPaneSearchEntries } from '@/components/settings/git-search'
|
||||
import { getGitProviderApiBudgetSearchEntries } from '@/components/settings/git-provider-api-budget-search'
|
||||
import { getCommitMessageAiPaneSearchEntries } from '@/components/settings/commit-message-ai-search'
|
||||
import { getTasksPaneSearchEntries } from '@/components/settings/tasks-search'
|
||||
import { getFloatingWorkspaceSearchEntries } from '@/components/settings/floating-workspace-search'
|
||||
@@ -239,7 +240,11 @@ export function buildSettingsNavigationMetadata({
|
||||
icon: GitBranch,
|
||||
// Why: Git AI Author is rendered inside Git, so shared
|
||||
// metadata must search both surfaces wherever Git appears.
|
||||
searchEntries: [...getGitPaneSearchEntries(), ...getCommitMessageAiPaneSearchEntries()],
|
||||
searchEntries: [
|
||||
...getGitPaneSearchEntries(),
|
||||
...getCommitMessageAiPaneSearchEntries(),
|
||||
...getGitProviderApiBudgetSearchEntries()
|
||||
],
|
||||
group: 'workflows'
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user