fix: show pull request unavailable state

Replace the empty PR tab with a clear unavailable message
Explain when pull request actions are available
This commit is contained in:
Bohdan Triapitsyn
2026-05-06 00:55:56 +03:00
parent 89f0e0a0e6
commit 6b25fd7d20
7 changed files with 16 additions and 1 deletions
@@ -1365,7 +1365,16 @@ export const PullRequestSection: React.FC<{
}, [directory, editBody, editTitle, github, prStatusKey, refresh, scheduleActionRefresh, updatePrStatus, t]);
if (!canShow) {
return null;
return (
<section className="border-0 bg-transparent rounded-none">
<div className="space-y-1 pt-3">
<div className="typography-ui-header font-semibold text-foreground">{t('gitView.pullRequest.title')}</div>
<div className="typography-micro text-muted-foreground">
{t('gitView.pullRequest.availableOnFeatureBranches')}
</div>
</div>
</section>
);
}
const originRepoUrl = status?.repo?.url || null;
+1
View File
@@ -674,6 +674,7 @@ export const dict = {
'gitView.pr.toast.titleRequired': 'Title is required',
'gitView.pr.toast.updatePrFailed': 'Failed to update pull request',
'gitView.pullRequest.createHint': 'Create and manage pull requests from this branch.',
'gitView.pullRequest.availableOnFeatureBranches': 'Available when the current branch can open a pull request.',
'gitView.pullRequest.title': 'Pull request',
'gitView.tabs.commit': 'Commit',
'gitView.tabs.pr': 'PR',
+1
View File
@@ -675,6 +675,7 @@ export const dict: Record<I18nKey, string> = {
"gitView.pr.toast.titleRequired": "El título es obligatorio",
"gitView.pr.toast.updatePrFailed": "No se pudo actualizar la PR",
"gitView.pullRequest.createHint": "Crea y gestiona PR desde esta rama.",
"gitView.pullRequest.availableOnFeatureBranches": "Disponible cuando la rama actual puede abrir un PR.",
"gitView.pullRequest.title": "PR",
"gitView.tabs.commit": "Commit",
"gitView.tabs.pr": "PR",
+1
View File
@@ -675,6 +675,7 @@ export const dict: Record<I18nKey, string> = {
'gitView.pr.toast.titleRequired': '제목 필수',
'gitView.pr.toast.updatePrFailed': 'PR 업데이트 실패',
'gitView.pullRequest.createHint': '이 브랜치에서 PR을 만들고 관리하세요.',
'gitView.pullRequest.availableOnFeatureBranches': '현재 브랜치에서 PR을 열 수 있을 때 사용할 수 있습니다.',
'gitView.pullRequest.title': 'PR',
'gitView.tabs.commit': '커밋',
'gitView.tabs.pr': 'PR',
@@ -675,6 +675,7 @@ export const dict: Record<I18nKey, string> = {
"gitView.pr.toast.titleRequired": "O título é obrigatório",
"gitView.pr.toast.updatePrFailed": "Não foi possível atualizar a PR",
"gitView.pullRequest.createHint": "Crie e gerencie PRs desta branch.",
"gitView.pullRequest.availableOnFeatureBranches": "Disponível quando a branch atual pode abrir uma PR.",
"gitView.pullRequest.title": "PR",
"gitView.tabs.commit": "Commit",
"gitView.tabs.pr": "PR",
+1
View File
@@ -675,6 +675,7 @@ export const dict: Record<I18nKey, string> = {
"gitView.pr.toast.titleRequired": "Необхідно вказати назву",
"gitView.pr.toast.updatePrFailed": "Не вдалося оновити PR",
"gitView.pullRequest.createHint": "Створюйте PR з цієї гілки та керуйте ними.",
"gitView.pullRequest.availableOnFeatureBranches": "Доступно, коли поточна гілка може відкрити PR.",
"gitView.pullRequest.title": "PR",
"gitView.tabs.commit": "Коміт",
"gitView.tabs.pr": "PR",
@@ -675,6 +675,7 @@ export const dict: Record<I18nKey, string> = {
'gitView.pr.toast.titleRequired': '标题不能为空',
'gitView.pr.toast.updatePrFailed': '更新拉取请求失败',
'gitView.pullRequest.createHint': '从当前分支创建并管理拉取请求。',
'gitView.pullRequest.availableOnFeatureBranches': '当前分支可以打开 PR 时可用。',
'gitView.pullRequest.title': '拉取请求',
'gitView.tabs.commit': '提交',
'gitView.tabs.pr': 'PR',