fix(app): simplify commits sidebar header
This commit is contained in:
@@ -7,7 +7,6 @@ import { useChangesPreferences } from "@/hooks/use-changes-preferences";
|
|||||||
import { useCheckoutCommitsQuery, type CheckoutCommitsQueryResult } from "@/git/use-commits-query";
|
import { useCheckoutCommitsQuery, type CheckoutCommitsQueryResult } from "@/git/use-commits-query";
|
||||||
import { ThemedChevron, chevronColorMapping } from "@/git/themed-chevron";
|
import { ThemedChevron, chevronColorMapping } from "@/git/themed-chevron";
|
||||||
import { CommitRow } from "./commit-row";
|
import { CommitRow } from "./commit-row";
|
||||||
import { dotStyles } from "./shared";
|
|
||||||
|
|
||||||
interface CommitsSectionProps {
|
interface CommitsSectionProps {
|
||||||
serverId: string;
|
serverId: string;
|
||||||
@@ -137,12 +136,6 @@ export function CommitsSection({ serverId, cwd, onCommitPress }: CommitsSectionP
|
|||||||
{commitCount}
|
{commitCount}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
<View style={styles.legend}>
|
|
||||||
<View style={dotStyles.dotLocal} />
|
|
||||||
<Text style={styles.legendText}>{t("workspace.git.diff.commits.legendLocal")}</Text>
|
|
||||||
<View style={dotStyles.legendDotRemote} />
|
|
||||||
<Text style={styles.legendText}>{t("workspace.git.diff.commits.legendRemote")}</Text>
|
|
||||||
</View>
|
|
||||||
</Pressable>
|
</Pressable>
|
||||||
{collapsed ? null : (
|
{collapsed ? null : (
|
||||||
<CommitsSectionContent query={query} now={displayNow} onCommitPress={onCommitPress} />
|
<CommitsSectionContent query={query} now={displayNow} onCommitPress={onCommitPress} />
|
||||||
@@ -177,7 +170,6 @@ const styles = StyleSheet.create((theme) => ({
|
|||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
fontSize: theme.fontSize.sm,
|
fontSize: theme.fontSize.sm,
|
||||||
fontWeight: theme.fontWeight.medium,
|
|
||||||
color: theme.colors.foreground,
|
color: theme.colors.foreground,
|
||||||
},
|
},
|
||||||
count: {
|
count: {
|
||||||
@@ -188,16 +180,6 @@ const styles = StyleSheet.create((theme) => ({
|
|||||||
countSpacer: {
|
countSpacer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
legend: {
|
|
||||||
flexDirection: "row",
|
|
||||||
alignItems: "center",
|
|
||||||
gap: theme.spacing[1],
|
|
||||||
flexShrink: 0,
|
|
||||||
},
|
|
||||||
legendText: {
|
|
||||||
fontSize: theme.fontSize.xs,
|
|
||||||
color: theme.colors.foregroundMuted,
|
|
||||||
},
|
|
||||||
list: {
|
list: {
|
||||||
paddingBottom: theme.spacing[1],
|
paddingBottom: theme.spacing[1],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,11 +13,8 @@ export const DOT_SIZE = 8;
|
|||||||
const REMOTE_DOT_OPACITY = 0.55;
|
const REMOTE_DOT_OPACITY = 0.55;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shared local/remote commit dot styles used by both the commit rows and the
|
* A local-only commit is a hollow ring; a commit that has reached the remote
|
||||||
* section legend so the two never drift.
|
* is a subtle (dimmed) filled green dot.
|
||||||
*
|
|
||||||
* Semantics: a local-only commit is a hollow ring; a commit that has reached
|
|
||||||
* the remote is a subtle (dimmed) filled green dot.
|
|
||||||
*/
|
*/
|
||||||
export const dotStyles = StyleSheet.create((theme) => ({
|
export const dotStyles = StyleSheet.create((theme) => ({
|
||||||
dotLocal: {
|
dotLocal: {
|
||||||
@@ -37,15 +34,4 @@ export const dotStyles = StyleSheet.create((theme) => ({
|
|||||||
opacity: REMOTE_DOT_OPACITY,
|
opacity: REMOTE_DOT_OPACITY,
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
},
|
},
|
||||||
// Legend variant of the remote dot: same fill, with leading spacing so it
|
|
||||||
// separates from the preceding "local" label in the section header legend.
|
|
||||||
legendDotRemote: {
|
|
||||||
width: DOT_SIZE,
|
|
||||||
height: DOT_SIZE,
|
|
||||||
borderRadius: theme.borderRadius.full,
|
|
||||||
backgroundColor: theme.colors.statusSuccess,
|
|
||||||
opacity: REMOTE_DOT_OPACITY,
|
|
||||||
flexShrink: 0,
|
|
||||||
marginLeft: theme.spacing[1],
|
|
||||||
},
|
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -788,8 +788,6 @@ export const ar: TranslationResources = {
|
|||||||
deletedFile: "تم الحذف",
|
deletedFile: "تم الحذف",
|
||||||
commits: {
|
commits: {
|
||||||
title: "الإيداعات",
|
title: "الإيداعات",
|
||||||
legendLocal: "محلي",
|
|
||||||
legendRemote: "على المستودع البعيد",
|
|
||||||
countLabel: "{{count}} إيداعات قبل الأساس",
|
countLabel: "{{count}} إيداعات قبل الأساس",
|
||||||
fileDiffEmpty: "لا توجد تغييرات لعرضها",
|
fileDiffEmpty: "لا توجد تغييرات لعرضها",
|
||||||
fileDiffError: "تعذّر تحميل فروق الملف",
|
fileDiffError: "تعذّر تحميل فروق الملف",
|
||||||
|
|||||||
@@ -798,8 +798,6 @@ export const en = {
|
|||||||
deletedFile: "Deleted",
|
deletedFile: "Deleted",
|
||||||
commits: {
|
commits: {
|
||||||
title: "Commits",
|
title: "Commits",
|
||||||
legendLocal: "local",
|
|
||||||
legendRemote: "on remote",
|
|
||||||
countLabel: "{{count}} commits ahead of base",
|
countLabel: "{{count}} commits ahead of base",
|
||||||
fileDiffEmpty: "No changes to display",
|
fileDiffEmpty: "No changes to display",
|
||||||
fileDiffError: "Failed to load file diff",
|
fileDiffError: "Failed to load file diff",
|
||||||
|
|||||||
@@ -819,8 +819,6 @@ export const es: TranslationResources = {
|
|||||||
deletedFile: "Eliminado",
|
deletedFile: "Eliminado",
|
||||||
commits: {
|
commits: {
|
||||||
title: "Commits",
|
title: "Commits",
|
||||||
legendLocal: "local",
|
|
||||||
legendRemote: "en remoto",
|
|
||||||
countLabel: "{{count}} commits por delante de la base",
|
countLabel: "{{count}} commits por delante de la base",
|
||||||
fileDiffEmpty: "No hay cambios para mostrar",
|
fileDiffEmpty: "No hay cambios para mostrar",
|
||||||
fileDiffError: "Error al cargar el diff del archivo",
|
fileDiffError: "Error al cargar el diff del archivo",
|
||||||
|
|||||||
@@ -818,8 +818,6 @@ export const fr: TranslationResources = {
|
|||||||
deletedFile: "Supprimé",
|
deletedFile: "Supprimé",
|
||||||
commits: {
|
commits: {
|
||||||
title: "Commits",
|
title: "Commits",
|
||||||
legendLocal: "local",
|
|
||||||
legendRemote: "sur le distant",
|
|
||||||
countLabel: "{{count}} commits en avance sur la base",
|
countLabel: "{{count}} commits en avance sur la base",
|
||||||
fileDiffEmpty: "Aucune modification à afficher",
|
fileDiffEmpty: "Aucune modification à afficher",
|
||||||
fileDiffError: "Échec du chargement du diff du fichier",
|
fileDiffError: "Échec du chargement du diff du fichier",
|
||||||
|
|||||||
@@ -799,8 +799,6 @@ export const ja: TranslationResources = {
|
|||||||
deletedFile: "削除済み",
|
deletedFile: "削除済み",
|
||||||
commits: {
|
commits: {
|
||||||
title: "コミット",
|
title: "コミット",
|
||||||
legendLocal: "ローカル",
|
|
||||||
legendRemote: "リモート",
|
|
||||||
countLabel: "ベースより先のコミット数: {{count}}",
|
countLabel: "ベースより先のコミット数: {{count}}",
|
||||||
fileDiffEmpty: "表示する変更はありません",
|
fileDiffEmpty: "表示する変更はありません",
|
||||||
fileDiffError: "ファイル差分の読み込みに失敗しました",
|
fileDiffError: "ファイル差分の読み込みに失敗しました",
|
||||||
|
|||||||
@@ -810,8 +810,6 @@ export const ptBR: TranslationResources = {
|
|||||||
deletedFile: "Excluído",
|
deletedFile: "Excluído",
|
||||||
commits: {
|
commits: {
|
||||||
title: "Commits",
|
title: "Commits",
|
||||||
legendLocal: "local",
|
|
||||||
legendRemote: "no remoto",
|
|
||||||
countLabel: "{{count}} commits à frente da base",
|
countLabel: "{{count}} commits à frente da base",
|
||||||
fileDiffEmpty: "Nenhuma alteração para exibir",
|
fileDiffEmpty: "Nenhuma alteração para exibir",
|
||||||
fileDiffError: "Falha ao carregar diff do arquivo",
|
fileDiffError: "Falha ao carregar diff do arquivo",
|
||||||
|
|||||||
@@ -810,8 +810,6 @@ export const ru: TranslationResources = {
|
|||||||
deletedFile: "Удалено",
|
deletedFile: "Удалено",
|
||||||
commits: {
|
commits: {
|
||||||
title: "Коммиты",
|
title: "Коммиты",
|
||||||
legendLocal: "локально",
|
|
||||||
legendRemote: "на удалённом",
|
|
||||||
countLabel: "{{count}} коммитов впереди базы",
|
countLabel: "{{count}} коммитов впереди базы",
|
||||||
fileDiffEmpty: "Нет изменений для отображения",
|
fileDiffEmpty: "Нет изменений для отображения",
|
||||||
fileDiffError: "Не удалось загрузить различия файла",
|
fileDiffError: "Не удалось загрузить различия файла",
|
||||||
|
|||||||
@@ -780,8 +780,6 @@ export const zhCN: TranslationResources = {
|
|||||||
deletedFile: "已删除",
|
deletedFile: "已删除",
|
||||||
commits: {
|
commits: {
|
||||||
title: "提交",
|
title: "提交",
|
||||||
legendLocal: "本地",
|
|
||||||
legendRemote: "已推送",
|
|
||||||
countLabel: "领先基线 {{count}} 个提交",
|
countLabel: "领先基线 {{count}} 个提交",
|
||||||
fileDiffEmpty: "没有可显示的更改",
|
fileDiffEmpty: "没有可显示的更改",
|
||||||
fileDiffError: "加载文件差异失败",
|
fileDiffError: "加载文件差异失败",
|
||||||
|
|||||||
Reference in New Issue
Block a user