mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 14:20:42 +08:00
Fix superfluous outer border on all lists
This also resets the fuzzy filter input when switching states in list views.
This commit is contained in:
committed by
Sebastian Martinez
parent
ae3258d7cb
commit
b11ada847f
@@ -33,6 +33,13 @@
|
||||
|
||||
let searchInput = $state("");
|
||||
|
||||
$effect(() => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
status;
|
||||
|
||||
searchInput = "";
|
||||
});
|
||||
|
||||
const searchableIssues = $derived(
|
||||
issues
|
||||
.flatMap(i => {
|
||||
@@ -62,6 +69,11 @@
|
||||
.container {
|
||||
padding: 1rem 1rem 1rem 0;
|
||||
}
|
||||
.list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
.header {
|
||||
font-weight: var(--font-weight-medium);
|
||||
font-size: var(--font-size-medium);
|
||||
@@ -136,34 +148,36 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Border
|
||||
variant={searchResults.length === 1 && searchInput !== ""
|
||||
? "secondary"
|
||||
: "float"}
|
||||
styleFlexDirection="column"
|
||||
styleOverflow="hidden"
|
||||
styleGap="2px"
|
||||
styleAlignItems="center"
|
||||
styleJustifyContent="center">
|
||||
<div class="list">
|
||||
{#each searchResults as result}
|
||||
<IssueTeaser issue={result.obj.issue} rid={repo.rid} {status} />
|
||||
<IssueTeaser
|
||||
focussed={searchResults.length === 1 && searchInput !== ""}
|
||||
issue={result.obj.issue}
|
||||
rid={repo.rid}
|
||||
{status} />
|
||||
{/each}
|
||||
|
||||
{#if searchResults.length === 0}
|
||||
<div
|
||||
class="global-flex"
|
||||
style:height="74px"
|
||||
style:justify-content="center">
|
||||
<div class="txt-missing txt-small global-flex" style:gap="0.25rem">
|
||||
<Icon name="none" />
|
||||
{#if issues.length > 0 && searchResults.length === 0}
|
||||
No matching issues.
|
||||
{:else}
|
||||
No {status === "all" ? "" : status} issues.
|
||||
{/if}
|
||||
<Border
|
||||
variant="ghost"
|
||||
styleFlexDirection="column"
|
||||
styleAlignItems="center"
|
||||
styleJustifyContent="center">
|
||||
<div
|
||||
class="global-flex"
|
||||
style:height="84px"
|
||||
style:justify-content="center">
|
||||
<div class="txt-missing txt-small global-flex" style:gap="0.25rem">
|
||||
<Icon name="none" />
|
||||
{#if issues.length > 0 && searchResults.length === 0}
|
||||
No matching issues.
|
||||
{:else}
|
||||
No {status === "all" ? "" : status} issues.
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Border>
|
||||
{/if}
|
||||
</Border>
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
|
||||
+34
-26
@@ -355,6 +355,11 @@
|
||||
margin-bottom: 0.5rem;
|
||||
color: var(--color-foreground-dim);
|
||||
}
|
||||
.list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
{#snippet icons(status: PatchStatus | undefined)}
|
||||
@@ -390,6 +395,7 @@
|
||||
|
||||
{#snippet secondColumn()}
|
||||
<div
|
||||
style:min-width="450px"
|
||||
class="txt-regular txt-semibold global-flex"
|
||||
style:min-height="2.5rem"
|
||||
style:margin-bottom="1rem">
|
||||
@@ -505,33 +511,35 @@
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<Border
|
||||
variant={searchResults.length === 1 && searchInput !== ""
|
||||
? "secondary"
|
||||
: "float"}
|
||||
styleFlexDirection="column"
|
||||
styleOverflow="hidden"
|
||||
styleGap="2px"
|
||||
styleAlignItems="center"
|
||||
styleJustifyContent="center">
|
||||
{#each searchResults as teaser}
|
||||
<PatchTeaser
|
||||
compact
|
||||
loadPatch={async (id: string) => {
|
||||
review = undefined;
|
||||
await loadPatch(id);
|
||||
}}
|
||||
patch={teaser.obj.patch}
|
||||
rid={repo.rid}
|
||||
{status}
|
||||
selected={teaser.obj.patch.id === patch.id} />
|
||||
{/each}
|
||||
|
||||
{#if searchResults.length === 0}
|
||||
{#if searchResults.length > 0}
|
||||
<div class="list">
|
||||
{#each searchResults as teaser}
|
||||
<PatchTeaser
|
||||
selected={teaser.obj.patch.id === patch.id}
|
||||
focussed={searchResults.length === 1 && searchInput !== ""}
|
||||
compact
|
||||
loadPatch={async (id: string) => {
|
||||
review = undefined;
|
||||
await loadPatch(id);
|
||||
}}
|
||||
patch={teaser.obj.patch}
|
||||
rid={repo.rid}
|
||||
{status} />
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if searchResults.length === 0}
|
||||
<Border
|
||||
variant="ghost"
|
||||
styleFlexDirection="column"
|
||||
styleOverflow="hidden"
|
||||
styleAlignItems="center"
|
||||
styleJustifyContent="center">
|
||||
<div
|
||||
class="global-flex"
|
||||
style:height="74px"
|
||||
style:min-width="440px"
|
||||
style:height="84px"
|
||||
style:justify-content="center">
|
||||
<div class="txt-missing txt-small global-flex" style:gap="0.25rem">
|
||||
<Icon name="none" />
|
||||
@@ -542,8 +550,8 @@
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</Border>
|
||||
</Border>
|
||||
{/if}
|
||||
{/snippet}
|
||||
|
||||
{#if review}
|
||||
|
||||
@@ -40,6 +40,13 @@
|
||||
more = patches.more;
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
status;
|
||||
|
||||
searchInput = "";
|
||||
});
|
||||
|
||||
async function loadMoreContent(all: boolean = false) {
|
||||
if (more) {
|
||||
const p = await invoke<PaginatedQuery<Patch[]>>("list_patches", {
|
||||
@@ -174,23 +181,23 @@
|
||||
</div>
|
||||
|
||||
<div class="list">
|
||||
<Border
|
||||
variant={searchResults.length === 1 && searchInput !== ""
|
||||
? "secondary"
|
||||
: "float"}
|
||||
styleFlexDirection="column"
|
||||
styleOverflow="hidden"
|
||||
styleGap="2px"
|
||||
styleAlignItems="center"
|
||||
styleJustifyContent="center">
|
||||
{#each searchResults as result}
|
||||
<PatchTeaser patch={result.obj.patch} rid={repo.rid} {status} />
|
||||
{/each}
|
||||
{#each searchResults as result}
|
||||
<PatchTeaser
|
||||
focussed={searchResults.length === 1 && searchInput !== ""}
|
||||
patch={result.obj.patch}
|
||||
rid={repo.rid}
|
||||
{status} />
|
||||
{/each}
|
||||
|
||||
{#if searchResults.length === 0}
|
||||
{#if searchResults.length === 0}
|
||||
<Border
|
||||
variant="ghost"
|
||||
styleFlexDirection="column"
|
||||
styleAlignItems="center"
|
||||
styleJustifyContent="center">
|
||||
<div
|
||||
class="global-flex"
|
||||
style:height="74px"
|
||||
style:height="84px"
|
||||
style:justify-content="center">
|
||||
<div class="txt-missing txt-small global-flex" style:gap="0.25rem">
|
||||
<Icon name="none" />
|
||||
@@ -201,8 +208,8 @@
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</Border>
|
||||
</Border>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
|
||||
Reference in New Issue
Block a user