Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(ide): show both places and the last commit date for every branch

rubenluetke10-beep736bf0505a53
diff --git a/jarvis/agentic_ide/git_overview.py b/jarvis/agentic_ide/git_overview.py
index 41af8eb05c..bf0389eea2 100644
--- a/jarvis/agentic_ide/git_overview.py
+++ b/jarvis/agentic_ide/git_overview.py
@@ -33,6 +33,7 @@ import subprocess
import threading
import time
from dataclasses import asdict, dataclass, field
+from datetime import datetime
from pathlib import Path
from typing import Any
@@ -341,6 +342,8 @@ class _GitHubSnapshot:
prs: list[PullRequest] = field(default_factory=list)
#: Branch name → (tip oid, CI of that tip).
refs: dict[str, tuple[str, CiStatus]] = field(default_factory=dict)
+ #: Branch name → its tip's commit time (unix seconds), for remote-only rows.
+ ref_dates: dict[str, int] = field(default_factory=dict)
@property
def busy(self) -> bool:
@@ -387,9 +390,23 @@ def parse_github(payload: dict[str, Any], fetched_at: float = 0.0) -> _GitHubSna
oid[:12],
ci_from_rollup(target.get("statusCheckRollup"), oid),
)
+ stamp = _iso_to_unix(str(target.get("committedDate") or ""))
+ if stamp:
+ snap.ref_dates[str(node["name"])] = stamp
return snap
+def _iso_to_unix(value: str) -> int:
+ """GitHub's ISO-8601 timestamp as unix seconds; 0 when it is missing or malformed."""
+ if not value:
+ return 0
+ try:
+ return int(datetime.fromisoformat(value.replace("Z", "+00:00")).timestamp())
+ except ValueError:
+ # An unreadable date only hides the row's date; the row itself stays.
+ return 0
+
+
def _fetch_github(repo: str, token: str) -> _GitHubSnapshot:
now = time.time()
owner, _, name = repo.partition("/")
@@ -650,7 +667,9 @@ def overview(folder: str | Path, *, refresh: bool = False, github: bool = True)
for name, (oid, _ci) in snap.refs.items():
if name in known:
continue
- row = BranchRow(name=name, remote_only=True, head=oid)
+ row = BranchRow(
+ name=name, remote_only=True, head=oid, committed_at=snap.ref_dates.get(name, 0)
+ )
_attach_github(row, name, snap)
info.remote_branches.append(row)
if len(info.remote_branches) >= MAX_REMOTE_ONLY:
diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/git/GitOverviewTab.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/git/GitOverviewTab.test.tsx
index b349149423..dcdb0dcfc0 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/git/GitOverviewTab.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/git/GitOverviewTab.test.tsx
@@ -275,19 +275,37 @@ describe("GitOverviewTab", () => {
expect(within(row("wip/local")).getByTestId("git-branch-link").tagName).toBe("SPAN");
});
- it("marks every branch as local only, on GitHub, or only on GitHub", async () => {
+ it("marks every branch as local only, local and on GitHub, or GitHub only", async () => {
answer = { ...OVERVIEW, branches: [...OVERVIEW.branches, branch("wip/local", { upstream: "", on_github: false })] };
render(<GitOverviewTab />);
await screen.findAllByTestId("git-branch-row");
const location = (name: string) => within(row(name)).getByTestId("git-location");
expect(location("wip/local").dataset.location).toBe("local");
expect(location("wip/local").textContent).toBe("local only");
- expect(location("main").dataset.location).toBe("github");
- expect(location("main").textContent).toBe("on GitHub");
+ expect(location("main").dataset.location).toBe("both");
+ expect(location("main").textContent).toBe("local + GitHub");
fireEvent.click(screen.getByTestId("git-remote-toggle"));
expect(location("only-remote").dataset.location).toBe("github_only");
});
+ it("shows when each branch last changed", async () => {
+ const now = Math.floor(Date.now() / 1000);
+ answer = {
+ ...OVERVIEW,
+ branches: [
+ branch("fresh", { committed_at: now - 2 * 3600 }),
+ branch("old", { committed_at: Date.UTC(2024, 2, 3, 12) / 1000 }),
+ branch("undated"),
+ ],
+ };
+ render(<GitOverviewTab />);
+ await screen.findAllByTestId("git-branch-row");
+ const date = (name: string) => within(row(name)).queryByTestId("git-commit-date")?.textContent;
+ expect(date("fresh")).toBe("2 hr. ago");
+ expect(date("old")).toBe("Mar 3, 2024");
+ expect(date("undated")).toBeUndefined();
+ });
+
it("offers GitHub pages and copies from a branch's menu", async () => {
render(<GitOverviewTab />);
await screen.findAllByTestId("git-branch-row");
diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/git/GitOverviewTab.tsx b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/git/GitOverviewTab.tsx
index 3a5caeb474..e01b859e0d 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/git/GitOverviewTab.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/git/GitOverviewTab.tsx
@@ -21,7 +21,7 @@ import {
Search,
X,
} from "lucide-react";
-import { fill, useT } from "@/i18n";
+import { fill, useT, useUiLanguage } from "@/i18n";
import { openExternalUrl } from "@/lib/openExternal";
import { cn } from "@/lib/utils";
import { QuickTooltip } from "@/components/ui/tooltip";
@@ -270,35 +270,65 @@ function MergedChips({ row }: { row: BranchRow }) {
);
}
-type BranchLocation = "local" | "github" | "github_only";
+type BranchLocation = "local" | "both" | "github_only";
function branchLocation(row: BranchRow): BranchLocation {
if (row.remote_only) return "github_only";
- return row.upstream || row.on_github ? "github" : "local";
+ return row.upstream || row.on_github ? "both" : "local";
}
-// Where the branch lives, readable at a glance: a laptop while it exists only
-// on this computer (amber — nothing backs it up yet), a globe once it is on GitHub.
-const LOCATION_STYLE: Record<BranchLocation, { icon: typeof Globe; tone: string; label: string; tip: string }> = {
- local: { icon: Laptop, tone: "border-warning/40 bg-warning/10 text-warning", label: "local_only", tip: "not_pushed" },
- github: { icon: Globe, tone: "border-info/35 bg-info/10 text-info", label: "on_github", tip: "on_github_tip" },
- github_only: { icon: Globe, tone: "border-info/35 bg-info/10 text-info", label: "github_only", tip: "github_only_tip" },
+// Where the branch lives, one icon per place: a laptop for this computer, a
+// globe for GitHub. Amber while it is only here — nothing backs it up yet.
+const LOCATION_STYLE: Record<BranchLocation, { local: boolean; github: boolean; text: string; chip: string }> = {
+ local: { local: true, github: false, text: "text-warning", chip: "border-warning/40 bg-warning/10" },
+ both: { local: true, github: true, text: "text-info", chip: "border-info/35 bg-info/10" },
+ github_only: { local: false, github: true, text: "text-muted-foreground", chip: "border-border bg-muted/40" },
};
+const LOCATION_LABEL: Record<BranchLocation, string> = { local: "local_only", both: "both", github_only: "github_only" };
+
function LocationChip({ row }: { row: BranchRow }) {
const t = useT();
const location = branchLocation(row);
const style = LOCATION_STYLE[location];
- const Icon = style.icon;
+ const label = LOCATION_LABEL[location];
return (
- <QuickTooltip content={t(`ide_side_panel.git.${style.tip}`)} side="bottom" className="inline-flex shrink-0">
+ <QuickTooltip content={t(`ide_side_panel.git.${label}_tip`)} side="bottom" className="inline-flex shrink-0">
<span
data-testid="git-location"
data-location={location}
- className={cn("inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[10.5px] font-medium leading-none", style.tone)}
+ className={cn("inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[10.5px] font-medium leading-none", style.chip, style.text)}
>
- <Icon className="h-3 w-3 shrink-0" aria-hidden />
- {t(`ide_side_panel.git.${style.label}`)}
+ {style.local && <Laptop className="h-3 w-3 shrink-0" aria-hidden />}
+ {style.github && <Globe className="h-3 w-3 shrink-0" aria-hidden />}
+ {t(`ide_side_panel.git.${label}`)}
+ </span>
+ </QuickTooltip>
+ );
+}
+
+/** Today's commits read "3 hours ago"; older ones show the day ("3 Oct", plus the year when it differs). */
+function commitDateLabel(seconds: number, lang: string, now = Date.now()): string {
+ const date = new Date(seconds * 1000);
+ const elapsed = Math.max(0, now - date.getTime());
+ if (elapsed < 24 * 3_600_000) {
+ const relative = new Intl.RelativeTimeFormat(lang, { numeric: "auto", style: "short" });
+ if (elapsed < 3_600_000) return relative.format(-Math.max(1, Math.round(elapsed / 60_000)), "minute");
+ return relative.format(-Math.round(elapsed / 3_600_000), "hour");
+ }
+ const sameYear = date.getFullYear() === new Date(now).getFullYear();
+ return new Intl.DateTimeFormat(lang, { day: "numeric", month: "short", ...(sameYear ? {} : { year: "numeric" }) }).format(date);
+}
+
+function CommitDate({ seconds }: { seconds: number }) {
+ const t = useT();
+ const lang = useUiLanguage();
+ if (!seconds) return null;
+ const full = new Intl.DateTimeFormat(lang, { dateStyle: "medium", timeStyle: "short" }).format(new Date(seconds * 1000));
+ return (
+ <QuickTooltip content={fill(t("ide_side_panel.git.last_commit"), { date: full })} side="bottom" className="inline-flex shrink-0">
+ <span data-testid="git-commit-date" className="tabular-nums">
+ {commitDateLabel(seconds, lang)}
</span>
</QuickTooltip>
);
@@ -363,6 +393,7 @@ function BranchLine({
</QuickTooltip>
<span className="mt-0.5 flex min-w-0 items-center gap-2 text-[10.5px] text-muted-foreground">
<LocationChip row={row} />
+ <CommitDate seconds={row.committed_at} />
<MergedChips row={row} />
{meta.length > 0 && <span className="shrink-0 tabular-nums">{meta.join(" · ")}</span>}
{row.worktree && <span className="shrink-0">{t("ide_side_panel.git.worktree_badge")}</span>}
@@ -508,14 +539,15 @@ function Legend() {
<GitMerge className="h-3.5 w-3.5 text-[hsl(var(--gh-merged))]" aria-hidden />
{t("ide_side_panel.git.legend_merged")}
</li>
- <li className="flex items-center gap-1.5">
- <Laptop className="h-3.5 w-3.5 text-warning" aria-hidden />
- {t("ide_side_panel.git.not_pushed")}
- </li>
- <li className="flex items-center gap-1.5">
- <Globe className="h-3.5 w-3.5 text-info" aria-hidden />
- {t("ide_side_panel.git.on_github_tip")}
- </li>
+ {(["local", "both", "github_only"] as const).map((location) => (
+ <li key={location} className="flex items-center gap-1.5">
+ <span className={cn("inline-flex items-center gap-0.5", LOCATION_STYLE[location].text)}>
+ {LOCATION_STYLE[location].local && <Laptop className="h-3.5 w-3.5" aria-hidden />}
+ {LOCATION_STYLE[location].github && <Globe className="h-3.5 w-3.5" aria-hidden />}
+ </span>
+ {t(`ide_side_panel.git.${LOCATION_LABEL[location]}_tip`)}
+ </li>
+ ))}
</ul>
</div>
);
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index 4885e1d1bd..56a9a52133 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -6227,10 +6227,12 @@
"ahead_behind": "↑{ahead} ↓{behind}",
"not_pushed": "Noch nicht zu GitHub gepusht",
"local_only": "nur lokal",
- "on_github": "auf GitHub",
- "on_github_tip": "Dieser Branch liegt auf GitHub.",
- "github_only": "nur auf GitHub",
- "github_only_tip": "Nur auf GitHub, nicht auf diesem Rechner ausgecheckt.",
+ "local_only_tip": "Nur auf diesem Rechner. Noch nicht zu GitHub gepusht.",
+ "both": "lokal + GitHub",
+ "both_tip": "Auf diesem Rechner und auf GitHub.",
+ "github_only": "nur GitHub",
+ "github_only_tip": "Nur auf GitHub, nicht auf diesem Rechner.",
+ "last_commit": "Letzter Commit: {date}",
"merged_short": "in {target}",
"merged_git": "In {target} gemergt: Jeder Commit dieses Branches ist in {target} enthalten.",
"merged_pr": "Über Pull Request #{number} in {target} gemergt.",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 1edb5335cc..827a05c28e 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -6260,10 +6260,12 @@
"ahead_behind": "↑{ahead} ↓{behind}",
"not_pushed": "Not pushed to GitHub yet",
"local_only": "local only",
- "on_github": "on GitHub",
- "on_github_tip": "This branch is on GitHub.",
- "github_only": "only on GitHub",
- "github_only_tip": "Only on GitHub, not checked out on this computer.",
+ "local_only_tip": "Only on this computer. Not pushed to GitHub yet.",
+ "both": "local + GitHub",
+ "both_tip": "On this computer and on GitHub.",
+ "github_only": "GitHub only",
+ "github_only_tip": "Only on GitHub, not on this computer.",
+ "last_commit": "Last commit: {date}",
"merged_short": "in {target}",
"merged_git": "Merged into {target}: every commit of this branch is in {target}.",
"merged_pr": "Merged into {target} through pull request #{number}.",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index fd0367410c..7c3104f699 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -6227,10 +6227,12 @@
"ahead_behind": "↑{ahead} ↓{behind}",
"not_pushed": "Aún no se ha subido a GitHub",
"local_only": "solo local",
- "on_github": "en GitHub",
- "on_github_tip": "Esta rama está en GitHub.",
- "github_only": "solo en GitHub",
+ "local_only_tip": "Solo en este ordenador. Aún no se ha subido a GitHub.",
+ "both": "local + GitHub",
+ "both_tip": "En este ordenador y en GitHub.",
+ "github_only": "solo GitHub",
"github_only_tip": "Solo en GitHub, no está en este ordenador.",
+ "last_commit": "Último commit: {date}",
"merged_short": "en {target}",
"merged_git": "Fusionada en {target}: todos los commits de esta rama están en {target}.",
"merged_pr": "Fusionada en {target} mediante el pull request #{number}.",
diff --git a/tests/unit/agentic_ide/test_git_overview.py b/tests/unit/agentic_ide/test_git_overview.py
index 48873018fa..c379cb1776 100644
--- a/tests/unit/agentic_ide/test_git_overview.py
+++ b/tests/unit/agentic_ide/test_git_overview.py
@@ -264,7 +264,14 @@ def test_overview_joins_pull_requests_ci_and_squash_merges(
],
refs=[
{"name": "main", "target": {"oid": "0" * 40, "statusCheckRollup": None}},
- {"name": "only-remote", "target": {"oid": "1" * 40, "statusCheckRollup": None}},
+ {
+ "name": "only-remote",
+ "target": {
+ "oid": "1" * 40,
+ "committedDate": "2026-10-01T12:00:00Z",
+ "statusCheckRollup": None,
+ },
+ },
],
),
fetched_at=git_overview.time.time(),
@@ -289,6 +296,8 @@ def test_overview_joins_pull_requests_ci_and_squash_merges(
assert by_name["main"].on_github
assert [row.name for row in info.remote_branches] == ["only-remote"]
assert info.remote_branches[0].pull_requests[0].state == "closed"
+ # Remote-only rows carry the tip commit date GitHub reports.
+ assert info.remote_branches[0].committed_at == 1_790_856_000
assert info.github.available and info.github.repo_url == "https://github.com/o/r"
# A second read inside the TTL reuses the answer instead of calling GitHub again.