mirror of
https://github.com/ChiChou/entdb.git
synced 2026-12-05 11:13:40 +01:00
fix(ui): review pass on labels and small-screen layout
- bin: Copy XML / Download sit on the path row, labelled; the code block no longer starts with a blank band reserved for floating buttons - diff: an empty diff names both versions - find: count no longer repeats the version from the header switcher; a uniform value is a value chip; the toolbar aligns left on phones and the breadcrumb stays on one line, truncating a long namespace - header: Keys / Files tabs keep an accessible name when only icons show Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
72f0c7ff50
commit
37fcbd28d9
7 files changed
+85
-47
No files matched your search
+1
-1
@@ -168,7 +168,7 @@
|
||||
*/
|
||||
.plist-code {
|
||||
margin: 0;
|
||||
padding: 2.5rem 1rem 1rem 0;
|
||||
padding: 1rem 1rem 1rem 0;
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--muted);
|
||||
|
||||
+20
-11
@@ -229,9 +229,25 @@ export default function BinaryDetail() {
|
||||
|
||||
{/* Main content */}
|
||||
<main className="flex-1 min-w-0 space-y-4">
|
||||
<p className="truncate text-muted-foreground" title={path || ""}>
|
||||
<code className="text-sm">{path}</code>
|
||||
</p>
|
||||
{/* The path, with the XML's actions on its row: floating over the
|
||||
code block they pushed its first line down. */}
|
||||
<div className="flex items-center gap-3">
|
||||
<p
|
||||
className="min-w-0 flex-1 truncate text-muted-foreground"
|
||||
title={path || ""}
|
||||
>
|
||||
<code className="text-sm">{path}</code>
|
||||
</p>
|
||||
{!loading && !compareWith && xml && (
|
||||
<div className="flex shrink-0 gap-1">
|
||||
<CopyButton text={xml} label="Copy XML" />
|
||||
<DownloadButton
|
||||
content={rawXml}
|
||||
filename={`${path?.split("/").pop() || "entitlements"}.plist`}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{loading && (
|
||||
<div className="space-y-2">
|
||||
@@ -254,14 +270,7 @@ export default function BinaryDetail() {
|
||||
)}
|
||||
|
||||
{!loading && !compareWith && xml && (
|
||||
<div className="relative">
|
||||
<div className="absolute right-2 top-2 z-10 flex gap-1">
|
||||
<CopyButton text={xml} />
|
||||
<DownloadButton
|
||||
content={rawXml}
|
||||
filename={`${path?.split("/").pop() || "entitlements"}.plist`}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<SyntaxHighlighter
|
||||
language="xml"
|
||||
showLineNumbers={true}
|
||||
|
||||
+28
-28
@@ -16,7 +16,6 @@ import Link from "next/link";
|
||||
import { redirect, useRouter, useSearchParams } from "next/navigation";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
|
||||
import { BetaBadge } from "@/components/beta-badge";
|
||||
import { ExpandAllToggle } from "@/components/expand-all-toggle";
|
||||
import FileSystem, { type PathStatus } from "@/components/filesystem";
|
||||
import { HeaderPortal } from "@/components/header-portal";
|
||||
@@ -379,28 +378,36 @@ export default function FindByKey() {
|
||||
they were (namespace, filter, comparison, scroll). */}
|
||||
<nav
|
||||
aria-label="Breadcrumb"
|
||||
className="mb-1.5 flex min-w-0 flex-wrap items-center gap-x-1 gap-y-0.5 text-sm"
|
||||
// One line: a long namespace ends in an ellipsis (full name in its
|
||||
// title) rather than wrapping away from its chevron.
|
||||
className="mb-1.5 flex min-w-0 items-center gap-x-1 text-sm"
|
||||
>
|
||||
<Link
|
||||
href={backUrl}
|
||||
onClick={returnToKeys}
|
||||
aria-label="Back to keys"
|
||||
title="Back to keys"
|
||||
className="mr-1 rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
|
||||
className="mr-1 shrink-0 rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
|
||||
>
|
||||
<ArrowLeft className="h-3.5 w-3.5" />
|
||||
</Link>
|
||||
{crumbs.map((crumb, i) => (
|
||||
<span key={crumb.ns || "(all)"} className="flex items-center gap-1">
|
||||
<span
|
||||
key={crumb.ns || "(all)"}
|
||||
className={cn(
|
||||
"flex min-w-0 items-center gap-1",
|
||||
i < crumbs.length - 1 && "shrink-0",
|
||||
)}
|
||||
>
|
||||
{i > 0 && (
|
||||
<ChevronRight className="h-3.5 w-3.5 text-muted-foreground/60" />
|
||||
<ChevronRight className="h-3.5 w-3.5 shrink-0 text-muted-foreground/60" />
|
||||
)}
|
||||
<Link
|
||||
href={crumb.ns === backNs ? backUrl : keysUrl(crumb.ns)}
|
||||
onClick={crumb.ns === backNs ? returnToKeys : undefined}
|
||||
title={crumb.ns || "All keys"}
|
||||
className={cn(
|
||||
"rounded px-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
||||
"truncate rounded px-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
||||
crumb.ns && "font-mono",
|
||||
)}
|
||||
>
|
||||
@@ -441,32 +448,25 @@ export default function FindByKey() {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="ml-auto flex flex-wrap items-center justify-end gap-2 text-sm">
|
||||
<div className="flex flex-wrap items-center gap-2 text-sm sm:ml-auto sm:justify-end">
|
||||
{/* The version is in the header's switcher; not repeated here. */}
|
||||
{!loading && (
|
||||
<span className="tabular-nums text-muted-foreground">
|
||||
{isFiltering ? `${list.length} of ${paths.length}` : paths.length}{" "}
|
||||
{paths.length === 1 ? "binary" : "binaries"}
|
||||
{currentVersion && (
|
||||
<>
|
||||
{" "}
|
||||
in {currentVersion.version}
|
||||
{currentVersion.beta && (
|
||||
<span className="ml-1 align-middle">
|
||||
<BetaBadge />
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{uniformValue !== undefined && (
|
||||
<>
|
||||
, all{" "}
|
||||
<code className="rounded bg-muted px-1 font-mono text-xs text-foreground">
|
||||
{typeof uniformValue === "string"
|
||||
? `"${uniformValue}"`
|
||||
: atomOf(uniformValue)}
|
||||
</code>
|
||||
</>
|
||||
)}
|
||||
</span>
|
||||
)}
|
||||
{!loading && uniformValue !== undefined && (
|
||||
<span
|
||||
className="inline-flex items-center gap-1.5 text-muted-foreground"
|
||||
title="Every binary has this value"
|
||||
>
|
||||
all
|
||||
<code className="rounded bg-value/8 px-1.5 font-mono text-xs leading-5 text-value ring-1 ring-inset ring-value/15">
|
||||
{typeof uniformValue === "string"
|
||||
? `"${uniformValue}"`
|
||||
: atomOf(uniformValue)}
|
||||
</code>
|
||||
</span>
|
||||
)}
|
||||
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import { Check, Copy } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { Copy, Check } from "lucide-react";
|
||||
import { Button } from "./ui/button";
|
||||
|
||||
export function CopyButton({ text }: { text: string }) {
|
||||
export function CopyButton({
|
||||
text,
|
||||
label = "Copy",
|
||||
}: {
|
||||
text: string;
|
||||
label?: string;
|
||||
}) {
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
const handleCopy = () => {
|
||||
@@ -15,11 +21,19 @@ export function CopyButton({ text }: { text: string }) {
|
||||
|
||||
return (
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={handleCopy}
|
||||
className={copied ? "text-green-600 border-green-600" : ""}
|
||||
title={copied ? "Copied" : label}
|
||||
className={`h-7 gap-1.5 px-2 text-xs ${copied ? "text-green-600 border-green-600" : ""}`}
|
||||
>
|
||||
{copied ? <Check className="w-4 h-4" /> : <Copy className="w-4 h-4" />}
|
||||
{copied ? (
|
||||
<Check className="h-3.5 w-3.5" />
|
||||
) : (
|
||||
<Copy className="h-3.5 w-3.5" />
|
||||
)}
|
||||
{copied ? "Copied" : label}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
@@ -40,7 +40,8 @@ export function DiffViewer({
|
||||
if (!hasChanges) {
|
||||
return (
|
||||
<div className="text-sm text-gray-500 dark:text-gray-400 p-4 border rounded-lg">
|
||||
No changes between versions
|
||||
No changes between {oldLabel.split("_")[0]} and{" "}
|
||||
{newLabel.split("_")[0]}.
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,9 +6,11 @@ import { Button } from "./ui/button";
|
||||
export function DownloadButton({
|
||||
content,
|
||||
filename,
|
||||
label = "Download",
|
||||
}: {
|
||||
content: string;
|
||||
filename: string;
|
||||
label?: string;
|
||||
}) {
|
||||
const handleDownload = () => {
|
||||
const blob = new Blob([content], { type: "application/xml" });
|
||||
@@ -23,8 +25,16 @@ export function DownloadButton({
|
||||
};
|
||||
|
||||
return (
|
||||
<Button variant="outline" onClick={handleDownload}>
|
||||
<Download className="w-4 h-4" />
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={handleDownload}
|
||||
title={`Download ${filename}`}
|
||||
className="h-7 gap-1.5 px-2 text-xs"
|
||||
>
|
||||
<Download className="h-3.5 w-3.5" />
|
||||
{label}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
@@ -54,6 +54,8 @@ function OSBreadcrumb({
|
||||
<div className="inline-flex rounded-lg border border-border p-1 bg-muted/30 shrink-0">
|
||||
<Link
|
||||
href={`/os/keys?os=${os}`}
|
||||
aria-label="Keys"
|
||||
title="Entitlement keys"
|
||||
className={`flex items-center gap-1 px-2 py-1 text-sm rounded-md transition-colors whitespace-nowrap ${
|
||||
currentPage === "keys"
|
||||
? "bg-background text-foreground shadow-sm font-medium"
|
||||
@@ -65,6 +67,8 @@ function OSBreadcrumb({
|
||||
</Link>
|
||||
<Link
|
||||
href={`/os/files?os=${os}`}
|
||||
aria-label="Files"
|
||||
title="Binaries by path"
|
||||
className={`flex items-center gap-1 px-2 py-1 text-sm rounded-md transition-colors whitespace-nowrap ${
|
||||
currentPage === "files"
|
||||
? "bg-background text-foreground shadow-sm font-medium"
|
||||
|
||||
Reference in new issue
Block a user