Atlas: short Recent and Stale badges so the card actions stay on one line

This commit is contained in:
MrAlders0n
2026-10-13 13:32:13 -04:00
parent c3d54c5d44
commit 33333b1a8d
4 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -95,8 +95,8 @@ export function AtlasCard({
{name || formatHex(node?.id ?? pin.id)}
</button>
{node && <Badge variant="default">{node.nodeTypeName}</Badge>}
{node?.stale === false && <Badge variant="live">{t("observerPage.statusRecent")}</Badge>}
{node?.stale === true && <Badge variant="stale">{t("observerPage.statusStale")}</Badge>}
{node?.stale === false && <Badge variant="live">{t("atlas.recent")}</Badge>}
{node?.stale === true && <Badge variant="stale">{t("atlas.stale")}</Badge>}
</span>
);
+2
View File
@@ -987,6 +987,8 @@
"lastSeen": "Last seen",
"meanHops": "Mean hops",
"heardBy": "Heard by",
"recent": "Recent",
"stale": "Stale",
"observers_one": "{{count}} observer heard the latest packet",
"observers_other": "{{count}} observers heard the latest packet",
"noReports": "No observations in this window.",
+2
View File
@@ -989,6 +989,8 @@
"lastSeen": "Vu pour la dernière fois",
"meanHops": "Sauts moyens",
"heardBy": "Entendu par",
"recent": "Récent",
"stale": "Périmé",
"observers_one": "{{count}} observateur a entendu le dernier paquet",
"observers_many": "{{count}} observateurs ont entendu le dernier paquet",
"observers_other": "{{count}} observateurs ont entendu le dernier paquet",
+2 -2
View File
@@ -56,7 +56,7 @@ describe("AtlasCard", () => {
mount();
expect(await screen.findByRole("button", { name: "Renamed repeater" })).toBeInTheDocument();
expect(screen.getByText("REPEATER")).toBeInTheDocument();
expect(screen.getByText("Recent status")).toBeInTheDocument();
expect(screen.getByText("Recent")).toBeInTheDocument();
expect(screen.getByText("Observations")).toBeInTheDocument();
expect(screen.getByText("Mean SNR")).toBeInTheDocument();
expect(screen.getByText("0.0 dB")).toBeInTheDocument();
@@ -71,7 +71,7 @@ describe("AtlasCard", () => {
it("shows the stale badge and the server's type name even when the type is unknown", async () => {
vi.mocked(api.getNode).mockResolvedValue({ ...node, stale: true, nodeType: 9, nodeTypeName: "WEIRD" });
mount();
expect(await screen.findByText("Status is stale")).toBeInTheDocument();
expect(await screen.findByText("Stale")).toBeInTheDocument();
expect(screen.getByText("WEIRD")).toBeInTheDocument();
expect(screen.queryByText(/atlas\.roles/)).not.toBeInTheDocument();
});