Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/ar/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ export const messages = {
'git.pull.none': 'لا توجد تغييرات للسحب',
'git.pull.unavailable': 'تعذّر فحص GitHub. تتم إعادة المحاولة تلقائيًا. {message}',
'git.pull.upToDate': 'محدّث بالفعل مع GitHub',
'git.reminder.chip': 'تغييرات بلا commit منذ {duration}',
'git.reminder.off': 'متوقف',
'git.reminder.setting': 'ذكّرني بعمل commit',
'git.reminder.settingValue': 'ذكّرني بعمل commit: {interval}',
'git.studio.branchExists': 'هذا الـ branch موجود بالفعل.',
'git.studio.branchGone': 'هذا الـ branch لم يعد موجودًا.',
'git.studio.branchLimit': 'يدعم Studio {max} branches كحد أقصى.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/de/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ export const messages = {
'git.pull.none': 'Keine Änderungen zum Abrufen',
'git.pull.unavailable': 'GitHub konnte nicht geprüft werden. Es wird automatisch erneut versucht. {message}',
'git.pull.upToDate': 'Bereits auf dem Stand von GitHub',
'git.reminder.chip': 'Seit {duration} ungespeicherte Änderungen',
'git.reminder.off': 'Aus',
'git.reminder.setting': 'Ans Speichern erinnern',
'git.reminder.settingValue': 'Ans Speichern erinnern: {interval}',
'git.studio.branchExists': 'Diesen Branch gibt es bereits.',
'git.studio.branchGone': 'Diesen Branch gibt es nicht mehr.',
'git.studio.branchLimit': 'Studio unterstützt höchstens {max} Branches.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/en/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ export const messages = {
'git.pull.none': 'No changes to pull',
'git.pull.unavailable': 'Could not check GitHub. Retrying automatically. {message}',
'git.pull.upToDate': 'Already up to date with GitHub',
'git.reminder.chip': 'Uncommitted changes for {duration}',
'git.reminder.off': 'Off',
'git.reminder.setting': 'Remind me to commit',
'git.reminder.settingValue': 'Remind me to commit: {interval}',
'git.studio.branchExists': 'This branch already exists.',
'git.studio.branchGone': 'This branch no longer exists.',
'git.studio.branchLimit': 'Studio supports at most {max} branches.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/es/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ export const messages = {
'git.pull.none': 'No hay cambios que descargar',
'git.pull.unavailable': 'No se pudo consultar GitHub. Se reintentará automáticamente. {message}',
'git.pull.upToDate': 'Ya está al día con GitHub',
'git.reminder.chip': 'Cambios sin guardar desde hace {duration}',
'git.reminder.off': 'Desactivado',
'git.reminder.setting': 'Recordarme guardar',
'git.reminder.settingValue': 'Recordarme guardar: {interval}',
'git.studio.branchExists': 'Esta rama ya existe.',
'git.studio.branchGone': 'Esta rama ya no existe.',
'git.studio.branchLimit': 'Studio admite como máximo {max} ramas.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/fr/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ export const messages = {
'git.pull.none': 'Aucune modification à récupérer',
'git.pull.unavailable': 'Impossible de joindre GitHub. Nouvelle tentative automatique. {message}',
'git.pull.upToDate': 'Déjà à jour avec GitHub',
'git.reminder.chip': 'Modifications non enregistrées depuis {duration}',
'git.reminder.off': 'Désactivé',
'git.reminder.setting': 'Me rappeler d’enregistrer',
'git.reminder.settingValue': 'Me rappeler d’enregistrer : {interval}',
'git.studio.branchExists': 'Cette branche existe déjà.',
'git.studio.branchGone': 'Cette branche n’existe plus.',
'git.studio.branchLimit': 'Studio prend en charge au plus {max} branches.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/he/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ export const messages = {
'git.pull.none': 'אין שינויים למשיכה',
'git.pull.unavailable': 'לא ניתן היה לבדוק את GitHub. מנסים שוב אוטומטית. {message}',
'git.pull.upToDate': 'כבר מעודכן מול GitHub',
'git.reminder.chip': 'שינויים בלי קומיט כבר {duration}',
'git.reminder.off': 'כבוי',
'git.reminder.setting': 'להזכיר לי לעשות קומיט',
'git.reminder.settingValue': 'להזכיר לי לעשות קומיט: {interval}',
'git.studio.branchExists': 'הענף הזה כבר קיים.',
'git.studio.branchGone': 'הענף הזה כבר לא קיים.',
'git.studio.branchLimit': 'Studio תומך בעד {max} ענפים.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/hi/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ export const messages = {
'git.pull.none': 'पुल करने के लिए कोई बदलाव नहीं',
'git.pull.unavailable': 'GitHub जाँचा नहीं जा सका। अपने आप फिर कोशिश हो रही है। {message}',
'git.pull.upToDate': 'GitHub के साथ पहले से अप-टू-डेट है',
'git.reminder.chip': '{duration} से बदलाव कमिट नहीं हुए',
'git.reminder.off': 'बंद',
'git.reminder.setting': 'कमिट करने की याद दिलाएँ',
'git.reminder.settingValue': 'कमिट करने की याद दिलाएँ: {interval}',
'git.studio.branchExists': 'यह ब्रांच पहले से मौजूद है।',
'git.studio.branchGone': 'यह ब्रांच अब मौजूद नहीं है।',
'git.studio.branchLimit': 'Studio अधिकतम {max} ब्रांच का समर्थन करता है।',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/id/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ export const messages = {
'git.pull.none': 'Tidak ada perubahan untuk di-pull',
'git.pull.unavailable': 'Tidak dapat memeriksa GitHub. Mencoba lagi secara otomatis. {message}',
'git.pull.upToDate': 'Sudah mutakhir dengan GitHub',
'git.reminder.chip': 'Perubahan belum di-commit selama {duration}',
'git.reminder.off': 'Mati',
'git.reminder.setting': 'Ingatkan saya untuk commit',
'git.reminder.settingValue': 'Ingatkan saya untuk commit: {interval}',
'git.studio.branchExists': 'Branch ini sudah ada.',
'git.studio.branchGone': 'Branch ini sudah tidak ada.',
'git.studio.branchLimit': 'Studio mendukung paling banyak {max} branch.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/it/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ export const messages = {
'git.pull.none': 'Nessuna modifica da scaricare',
'git.pull.unavailable': 'Impossibile controllare GitHub. Nuovo tentativo automatico. {message}',
'git.pull.upToDate': 'Già aggiornato con GitHub',
'git.reminder.chip': 'Modifiche senza commit da {duration}',
'git.reminder.off': 'Disattivato',
'git.reminder.setting': 'Ricordami di fare il commit',
'git.reminder.settingValue': 'Ricordami di fare il commit: {interval}',
'git.studio.branchExists': 'Questo branch esiste già.',
'git.studio.branchGone': 'Questo branch non esiste più.',
'git.studio.branchLimit': 'Studio supporta al massimo {max} branch.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/ja/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ export const messages = {
'git.pull.none': 'プルする変更はありません',
'git.pull.unavailable': 'GitHub を確認できませんでした。自動で再試行します。{message}',
'git.pull.upToDate': 'GitHub と同期済みです',
'git.reminder.chip': '{duration}コミットされていない変更があります',
'git.reminder.off': 'オフ',
'git.reminder.setting': 'コミットのリマインダー',
'git.reminder.settingValue': 'コミットのリマインダー:{interval}',
'git.studio.branchExists': 'このブランチはすでに存在します。',
'git.studio.branchGone': 'このブランチはもう存在しません。',
'git.studio.branchLimit': 'Studio でサポートされるブランチは最大 {max} 個です。',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/ko/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ export const messages = {
'git.pull.none': '가져올 변경 사항 없음',
'git.pull.unavailable': 'GitHub를 확인할 수 없습니다. 자동으로 다시 시도합니다. {message}',
'git.pull.upToDate': '이미 GitHub와 최신 상태입니다',
'git.reminder.chip': '{duration} 동안 커밋하지 않은 변경 사항',
'git.reminder.off': '끔',
'git.reminder.setting': '커밋 알림',
'git.reminder.settingValue': '커밋 알림: {interval}',
'git.studio.branchExists': '이 브랜치는 이미 있습니다.',
'git.studio.branchGone': '이 브랜치는 더 이상 존재하지 않습니다.',
'git.studio.branchLimit': 'Studio는 최대 {max}개의 브랜치를 지원합니다.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/nl/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ export const messages = {
'git.pull.none': 'Geen wijzigingen om te pullen',
'git.pull.unavailable': 'GitHub kon niet worden gecontroleerd. Er wordt automatisch opnieuw geprobeerd. {message}',
'git.pull.upToDate': 'Al up-to-date met GitHub',
'git.reminder.chip': 'Al {duration} niet-gecommitte wijzigingen',
'git.reminder.off': 'Uit',
'git.reminder.setting': 'Herinner me aan committen',
'git.reminder.settingValue': 'Herinner me aan committen: {interval}',
'git.studio.branchExists': 'Deze branch bestaat al.',
'git.studio.branchGone': 'Deze branch bestaat niet meer.',
'git.studio.branchLimit': 'Studio ondersteunt maximaal {max} branches.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/pl/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ export const messages = {
'git.pull.none': 'Brak zmian do pobrania',
'git.pull.unavailable': 'Nie udało się sprawdzić GitHub. Ponawiam automatycznie. {message}',
'git.pull.upToDate': 'Aktualne względem GitHub',
'git.reminder.chip': 'Niezatwierdzone zmiany od {duration}',
'git.reminder.off': 'Wyłączone',
'git.reminder.setting': 'Przypominaj o zatwierdzaniu',
'git.reminder.settingValue': 'Przypominaj o zatwierdzaniu: {interval}',
'git.studio.branchExists': 'Ta gałąź już istnieje.',
'git.studio.branchGone': 'Ta gałąź już nie istnieje.',
'git.studio.branchLimit': 'Studio obsługuje co najwyżej {max} gałęzi.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/ptBR/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ export const messages = {
'git.pull.none': 'Nenhuma alteração para baixar',
'git.pull.unavailable': 'Não foi possível consultar o GitHub. Tentando novamente de forma automática. {message}',
'git.pull.upToDate': 'Já está em dia com o GitHub',
'git.reminder.chip': 'Alterações não salvas há {duration}',
'git.reminder.off': 'Desativado',
'git.reminder.setting': 'Lembrar de salvar',
'git.reminder.settingValue': 'Lembrar de salvar: {interval}',
'git.studio.branchExists': 'Este branch já existe.',
'git.studio.branchGone': 'Este branch não existe mais.',
'git.studio.branchLimit': 'O Studio aceita no máximo {max} branches.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/ru/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ export const messages = {
'git.pull.none': 'Нет изменений для получения',
'git.pull.unavailable': 'Не удалось проверить GitHub. Повтор выполняется автоматически. {message}',
'git.pull.upToDate': 'Уже синхронизировано с GitHub',
'git.reminder.chip': 'Незакоммиченные изменения: {duration}',
'git.reminder.off': 'Выкл.',
'git.reminder.setting': 'Напоминать о коммите',
'git.reminder.settingValue': 'Напоминать о коммите: {interval}',
'git.studio.branchExists': 'Такая ветка уже существует.',
'git.studio.branchGone': 'Этой ветки больше нет.',
'git.studio.branchLimit': 'Studio поддерживает не более {max} веток.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/tr/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ export const messages = {
'git.pull.none': 'Çekilecek değişiklik yok',
'git.pull.unavailable': 'GitHub denetlenemedi. Otomatik olarak yeniden deneniyor. {message}',
'git.pull.upToDate': 'GitHub ile zaten güncel',
'git.reminder.chip': '{duration} süredir commit edilmemiş değişiklikler',
'git.reminder.off': 'Kapalı',
'git.reminder.setting': 'Commit etmeyi hatırlat',
'git.reminder.settingValue': 'Commit etmeyi hatırlat: {interval}',
'git.studio.branchExists': 'Bu dal zaten var.',
'git.studio.branchGone': 'Bu dal artık yok.',
'git.studio.branchLimit': 'Studio en fazla {max} dalı destekler.',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/zhCN/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ export const messages = {
'git.pull.none': '没有可拉取的更改',
'git.pull.unavailable': '无法检查 GitHub,正在自动重试。{message}',
'git.pull.upToDate': '已与 GitHub 保持同步',
'git.reminder.chip': '已有 {duration} 未提交的更改',
'git.reminder.off': '关闭',
'git.reminder.setting': '提醒我提交',
'git.reminder.settingValue': '提醒我提交:{interval}',
'git.studio.branchExists': '此分支已存在。',
'git.studio.branchGone': '此分支已不存在。',
'git.studio.branchLimit': 'Studio 最多支持 {max} 个分支。',
Expand Down
4 changes: 4 additions & 0 deletions shared/properties/i18n/messages/zhTW/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ export const messages = {
'git.pull.none': '沒有可提取的變更',
'git.pull.unavailable': '無法檢查 GitHub。將自動重試。{message}',
'git.pull.upToDate': '已與 GitHub 同步',
'git.reminder.chip': '已有 {duration} 未提交的變更',
'git.reminder.off': '關閉',
'git.reminder.setting': '提醒我提交',
'git.reminder.settingValue': '提醒我提交:{interval}',
'git.studio.branchExists': '此分支已存在。',
'git.studio.branchGone': '此分支已不存在。',
'git.studio.branchLimit': 'Studio 最多支援 {max} 個分支。',
Expand Down
17 changes: 16 additions & 1 deletion src/app/LeftRail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { shownSettingsView, subscribeShownSettingsView, type SettingsFocusTarget
import { shortcutOf, railActionOf, type RailAction } from './railShortcuts';
import { FEATURE_ICONS, type FeatureIconComponent } from './featureIcons';
import { AppsRailBadge } from '../features/apps/appUpdates';
import { CommitReminderRailBadge } from './shell/DesktopGitPull';
import { AppTile } from '../features/apps/AppTile';
import { RailAppFace, openPinnedApp, railAppId, usePinnedRailApps, useShownPinnedApp } from './railApps';
import { useAppsRuntime } from '../features/apps/appsRuntime';
Expand Down Expand Up @@ -140,7 +141,7 @@ export default function LeftRail({
tooltip: translate('rail.withShortcut', { label: translate(titleKey), shortcut }),
pressed: activeId === id,
select: () => onSelect(id),
badge: id === 'apps' ? <AppsRailBadge admin={role.isAdmin} /> : undefined,
badge: railBadge(id, { admin: role.isAdmin, pressed: activeId === id }),
});
}
// A Settings view moved onto the rail opens Settings at it, and closes the panel when that view already shows.
Expand Down Expand Up @@ -421,6 +422,20 @@ export default function LeftRail({
);
}

/**
* What a panel button carries in its corner: the Apps tab its count and waiting updates, the Git tab a due reminder to
* commit, except while the Git panel is open, where the reminder's note already shows. Exported so a test can pin that.
*/
export function railBadge(id: RailPanelId, { admin, pressed }: { readonly admin: boolean; readonly pressed: boolean }): ReactNode {
if (id === 'apps') {
return <AppsRailBadge admin={admin} />;
}
if (id === 'history') {
return pressed ? undefined : <CommitReminderRailBadge />;
}
return undefined;
}

function useRailKeys({ componentOpen }: { readonly componentOpen: boolean }, onAction: (action: RailAction) => void): void {
// The chords are the table's (railShortcuts.ts); they are ignored while typing in a field.
useEffect(() => {
Expand Down
4 changes: 3 additions & 1 deletion src/app/shell/AppShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import StructurePanel from '../../features/structure/StructurePanel';
import PanelBoundary from '../../ui/PanelBoundary';
import GitChip from '../../features/git/GitChip';
import { GitSessionDialogs } from '../../features/git/GitSessionDialogs';
import { DesktopGitContext, TitleBarPull, useDesktopGit, useDesktopGitControls } from './DesktopGitPull';
import { DesktopGitContext, TitleBarPull, useDesktopGit, useDesktopGitControls, useCommitReminderText } from './DesktopGitPull';
import HistoryPanel from '../../features/history/HistoryPanel';
import { ConfirmHost, confirmDialog } from '../../ui/ConfirmDialog';
import { UpdatePopupHost } from '../../features/update/UpdatePopup';
Expand Down Expand Up @@ -311,6 +311,7 @@ export function AppOverlays({ app }: { readonly app: ShellView }) {
export function TitleBar({ app }: { readonly app: ShellView }) {
const translate = useTranslate();
const canPublish = can(useCurrentRole(), 'publish');
const commitReminder = useCommitReminderText();
const componentCanvas = useComponentCanvas();
// On the canvas page the way back leaves the canvas; inside an instance, back steps out one level as anywhere, and
// Close canvas beside it leaves from any depth.
Expand Down Expand Up @@ -386,6 +387,7 @@ export function TitleBar({ app }: { readonly app: ShellView }) {
withBranchChange={app.withBranchChange}
onBranchSwitched={app.reloadFromDisk}
beforeBranch={<TitleBarPull />}
commitReminder={commitReminder}
/>
)}
{/* A role that may pull but not publish has no branch chip; the button stands in its place. */}
Expand Down
30 changes: 29 additions & 1 deletion src/app/shell/DesktopGitPull.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { useGitSession, type GitSession } from '../../features/git/useGitSession
import type { ComponentCanvasControl } from '../../features/preview/componentCanvas/componentCanvasSession';
import { currentDesktopPlatform } from '../../lib/shortcutLabel';
import { translateFailure } from '../../lib/i18n/translateErrorText';
import { useTranslate } from '../../lib/i18n/useTranslate';
import { useFormat, useTranslate } from '../../lib/i18n/useTranslate';
import { commitReminderDuration } from '../../features/git/useGitSession';
import { useCurrentRole } from '../../lib/useCurrentRole';
import { canRailTab } from '../../lib/roleAccess';
import { windowHeld } from '../../ui/busyLock';
Expand Down Expand Up @@ -175,6 +176,33 @@ export function useDesktopGitControls(): { readonly session: GitSession; readonl
return { session: git.session, shortcut: git.access === 'allowed' ? git.shortcut : undefined };
}

/** The rail's Git tab once the reminder to commit is due: the rail's dot, with the branch chip's sentence for a screen reader. */
export function CommitReminderRailBadge() {
const text = useCommitReminderText();
if (text === undefined) {
return undefined;
}
return <span className="rail-badge" role="status" aria-label={text} />;
}

/**
* What the branch chip and the Git tab say once the reminder to commit is due (features/git/useGitSession.ts), or
* undefined: while it is quiet, and for a role without the Git panel, which has nowhere to commit from.
*/
export function useCommitReminderText(): string | undefined {
const git = useContext(DesktopGitContext);
const translate = useTranslate();
const format = useFormat();
if (git === undefined || git.access === 'denied') {
return undefined;
}
const { reminder } = git.session;
if (reminder.state.kind === 'quiet') {
return undefined;
}
return translate('git.reminder.chip', { duration: commitReminderDuration(reminder.nowMs - reminder.state.sinceMs, format) });
}

/** The title bar's button: absent without something to pull, or where pulling is refused. */
export function TitleBarPull() {
const git = useContext(DesktopGitContext);
Expand Down
4 changes: 3 additions & 1 deletion src/app/shell/DesktopPublishButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ interface Props {
readonly onBranchSwitched?: (() => Promise<unknown>) | undefined;
/** Drawn just before the branch chip (the pull button), so Publish and the chip hold still as it comes and goes. */
readonly beforeBranch?: ReactNode;
/** The reminder to commit, once due: the branch chip carries a dot and says it (features/git/useGitSession.ts). */
readonly commitReminder?: string | undefined;
}

export function DesktopPublishButton(props: Props) {
Expand Down Expand Up @@ -82,7 +84,7 @@ function DesktopPublishSession(props: Props) {
return (
<div className="stacki-publish-control stacki-publish-cluster">
{props.beforeBranch}
<BranchIndicator projectPath={projectPath} info={repository} onOpen={onOpenBranches} />
<BranchIndicator projectPath={projectPath} info={repository} onOpen={onOpenBranches} reminder={props.commitReminder} />
<RefreshGitWhenAiTurnEnds refresh={refresh} />
<PublishControl
projectPath={projectPath}
Expand Down
Loading
Loading