mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
fix(schedules): render schedule-only worktrees and fix job detail mobile layout
- mount the worktrees session list for schedule-only repos so kept worktrees are visible and expandable - keep worktree groups mounted while sessions load so schedule group expansion is not reset - constrain the job detail grid on mobile so the worktree path no longer overflows and clips - label the icon-only Remove all worktrees button - avoid invalid p-in-p nesting in the clear history description
This commit is contained in:
1 parent
26ff08d891
commit
8ac0f31758
4 files changed
+6
-9
No files matched your search
@@ -97,7 +97,7 @@ export function JobDetailTab({
|
||||
</div>
|
||||
|
||||
<div className="p-3 sm:p-6">
|
||||
<div className="grid gap-4 lg:grid-cols-[minmax(0,1fr)_280px]">
|
||||
<div className="grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,1fr)_280px]">
|
||||
<div className="space-y-4">
|
||||
<section className="rounded-lg border border-border/60 bg-background/40 p-3 sm:p-4">
|
||||
<div className="mb-3">
|
||||
@@ -127,6 +127,7 @@ export function JobDetailTab({
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
aria-label="Remove all worktrees"
|
||||
onClick={() => removeWorktrees.mutate({ repoId: selectedJob.repoId, jobId: selectedJob.id })}
|
||||
disabled={removeWorktrees.isPending || idleWorktreeCount === 0}
|
||||
>
|
||||
|
||||
@@ -110,7 +110,7 @@ export const SessionList = ({
|
||||
}
|
||||
}, [isLoading, filteredSessions, hasNextPage, isFetchingNextPage, isFetchNextPageError, fetchNextPage]);
|
||||
|
||||
if (isLoading) {
|
||||
if (isLoading && !renderSessions) {
|
||||
return <div className="p-4 text-sm text-muted-foreground">Loading sessions...</div>;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ export const SessionList = ({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (hasNextPage || isFetchingNextPage) {
|
||||
if ((hasNextPage || isFetchingNextPage) && !renderSessions) {
|
||||
return <div className="p-4 text-sm text-muted-foreground">Loading sessions...</div>;
|
||||
}
|
||||
if (!searchQuery.trim() && !renderSessions) {
|
||||
|
||||
@@ -270,11 +270,7 @@ export function RepoDetail() {
|
||||
/>
|
||||
|
||||
<div className="flex-1 flex flex-col min-h-0">
|
||||
{showWorktrees && workspaceSiblings.length === 0 ? (
|
||||
<div className="px-4 pt-4">
|
||||
{renderWorktreeGroups({ sessions: [], searchQuery: "", renderSessionCard: () => null })}
|
||||
</div>
|
||||
) : sessionListDirectories.length > 0 && (
|
||||
{(showWorktrees || sessionListDirectories.length > 0) && (
|
||||
<SessionList
|
||||
key={showWorktrees ? "worktrees" : "repo"}
|
||||
directories={sessionListDirectories}
|
||||
|
||||
@@ -387,7 +387,7 @@ export function Schedules() {
|
||||
onOpenChange={(open) => !open && setClearRunsOpen(false)}
|
||||
title="Clear run history"
|
||||
description={
|
||||
<p>This permanently deletes all <strong>{clearableRuns.length}</strong> finished run{clearableRuns.length === 1 ? '' : 's'} for this schedule. A run in progress is kept. This cannot be undone.</p>
|
||||
<>This permanently deletes all <strong>{clearableRuns.length}</strong> finished run{clearableRuns.length === 1 ? '' : 's'} for this schedule. A run in progress is kept. This cannot be undone.</>
|
||||
}
|
||||
affectedWorktreeCount={affectedClearWorktreeCount}
|
||||
isPending={clearRunsMutation.isPending}
|
||||
|
||||
Reference in new issue
Block a user