fix(codebase): remove legacy single-codebase hint description from api endpoints
This commit is contained in:
@@ -48,95 +48,124 @@ export default function CodeTab() {
|
||||
const showLoading = loading && !anatomy;
|
||||
|
||||
return (
|
||||
<div style={{ minHeight: "100vh", background: THEME.canvasGradient, fontFamily: THEME.font, padding: "36px 48px" }}>
|
||||
<div
|
||||
style={{
|
||||
minHeight: "100vh",
|
||||
background: THEME.canvasGradient,
|
||||
fontFamily: THEME.font,
|
||||
padding: "36px 48px",
|
||||
}}
|
||||
>
|
||||
<div style={{ maxWidth: 1400, margin: "0 auto" }}>
|
||||
<PageHeader title="Codebase" subtitle="Explore the repository files for your application." />
|
||||
<div style={grid}>
|
||||
{/* ── Left rail ── */}
|
||||
<section style={leftCol}>
|
||||
{showLoading && (
|
||||
<PageHeader
|
||||
title="Codebase"
|
||||
subtitle="Explore the repository files for your application."
|
||||
/>
|
||||
<div style={grid}>
|
||||
{/* ── Left rail ── */}
|
||||
<section style={leftCol}>
|
||||
{showLoading && (
|
||||
<Card>
|
||||
<div style={{ display: "flex", alignItems: "center", gap: 8, color: THEME.mid, fontSize: "0.875rem" }}>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: 8,
|
||||
color: THEME.mid,
|
||||
fontSize: "0.875rem",
|
||||
}}
|
||||
>
|
||||
<Loader2 size={15} className="animate-spin" /> Loading…
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
{error && !showLoading && (
|
||||
{error && !showLoading && (
|
||||
<Card>
|
||||
<div style={{ display: "flex", alignItems: "center", gap: 8, color: THEME.danger, fontSize: "0.875rem" }}>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: 8,
|
||||
color: THEME.danger,
|
||||
fontSize: "0.875rem",
|
||||
}}
|
||||
>
|
||||
<AlertCircle size={15} /> {error}
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
|
||||
{anatomy && (
|
||||
<>
|
||||
{/* Code Files */}
|
||||
<RailGroup title="Code files" count={codebases?.length ?? 0}>
|
||||
{codebases && codebases.length === 0 && (
|
||||
<RailEmpty>
|
||||
{reason === "no_repo" ? (
|
||||
<>
|
||||
No codebase yet.{" "}
|
||||
<span style={nudge}>
|
||||
Try: "Start building my app"
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
Repo is empty — push a first commit.{" "}
|
||||
<span style={nudge}>
|
||||
Try: "Scaffold a Next.js app"
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</RailEmpty>
|
||||
)}
|
||||
{codebases?.map((cb) => {
|
||||
return (
|
||||
<article key={cb.id} style={codebaseTile}>
|
||||
<div style={tileHeader}>
|
||||
<span style={chevronCell}>
|
||||
<ChevronDown size={13} style={{ color: THEME.mid }} />
|
||||
</span>
|
||||
<Box
|
||||
size={13}
|
||||
style={{ color: THEME.mid, flexShrink: 0 }}
|
||||
/>
|
||||
<div style={{ minWidth: 0, textAlign: "left" }}>
|
||||
<div style={tileLabel}>{cb.label}</div>
|
||||
{cb.hint && <div style={tileHint}>{cb.hint}</div>}
|
||||
{anatomy && (
|
||||
<>
|
||||
{/* Code Files */}
|
||||
<RailGroup title="Code files" count={codebases?.length ?? 0}>
|
||||
{codebases && codebases.length === 0 && (
|
||||
<RailEmpty>
|
||||
{reason === "no_repo" ? (
|
||||
<>
|
||||
No codebase yet.{" "}
|
||||
<span style={nudge}>
|
||||
Try: "Start building my app"
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
Repo is empty — push a first commit.{" "}
|
||||
<span style={nudge}>
|
||||
Try: "Scaffold a Next.js app"
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</RailEmpty>
|
||||
)}
|
||||
{codebases?.map((cb) => {
|
||||
return (
|
||||
<article key={cb.id} style={codebaseTile}>
|
||||
<div style={tileHeader}>
|
||||
<span style={chevronCell}>
|
||||
<ChevronDown
|
||||
size={13}
|
||||
style={{ color: THEME.mid }}
|
||||
/>
|
||||
</span>
|
||||
<Box
|
||||
size={13}
|
||||
style={{ color: THEME.mid, flexShrink: 0 }}
|
||||
/>
|
||||
<div style={{ minWidth: 0, textAlign: "left" }}>
|
||||
<div style={tileLabel}>{cb.label}</div>
|
||||
{cb.hint && <div style={tileHint}>{cb.hint}</div>}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style={tileBody}>
|
||||
<GiteaFileTree
|
||||
projectId={projectId}
|
||||
rootPath={cb.path}
|
||||
selectedPath={
|
||||
selection?.type === "file" &&
|
||||
selection.codebaseId === cb.id
|
||||
? selection.path
|
||||
: undefined
|
||||
}
|
||||
onSelectFile={(p) =>
|
||||
setSelection({
|
||||
type: "file",
|
||||
codebaseId: cb.id,
|
||||
path: p,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
})}
|
||||
</RailGroup>
|
||||
</>
|
||||
)}
|
||||
</section>
|
||||
<div style={tileBody}>
|
||||
<GiteaFileTree
|
||||
projectId={projectId}
|
||||
rootPath={cb.path}
|
||||
selectedPath={
|
||||
selection?.type === "file" &&
|
||||
selection.codebaseId === cb.id
|
||||
? selection.path
|
||||
: undefined
|
||||
}
|
||||
onSelectFile={(p) =>
|
||||
setSelection({
|
||||
type: "file",
|
||||
codebaseId: cb.id,
|
||||
path: p,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
})}
|
||||
</RailGroup>
|
||||
</>
|
||||
)}
|
||||
</section>
|
||||
|
||||
{/* ── Right pane ── */}
|
||||
<aside style={rightCol}>
|
||||
{/* ── Right pane ── */}
|
||||
<aside style={rightCol}>
|
||||
<Card
|
||||
padding={0}
|
||||
style={{
|
||||
@@ -150,13 +179,24 @@ export default function CodeTab() {
|
||||
<GiteaFileViewer projectId={projectId} path={selection.path} />
|
||||
)}
|
||||
{!selection && (
|
||||
<div style={{ flex: 1, display: "flex", alignItems: "center", justifyContent: "center", color: THEME.muted, fontSize: "0.85rem", padding: "32px 16px", textAlign: "center" }}>
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
color: THEME.muted,
|
||||
fontSize: "0.85rem",
|
||||
padding: "32px 16px",
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
Pick a codebase file on the left.
|
||||
</div>
|
||||
)}
|
||||
</Card>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user