Align the layout to be consistent throughout all dialogs (#1737)

This commit is contained in:
Aditya Chandel
2025-12-02 16:31:19 -07:00
committed by GitHub
parent 8e8d57af73
commit 6b0b078044
38 changed files with 3663 additions and 1328 deletions
@@ -1,25 +1,24 @@
<div class="overflow-x-auto">
<div class="flex flex-col h-[calc(100dvh-6.1rem)] rounded-xl overflow-hidden bg-[var(--card-background)] space-y-4 min-w-[100rem] border-[1px] border-solid border-[var(--p-content-border-color)]">
<div class="px-4 md:px-6 pt-6 pb-4 flex flex-col md:flex-row md:items-center md:justify-between">
<div>
<h2 class="text-xl font-semibold pb-1 flex items-center gap-2">
<div class="container">
<div class="main-card">
<div class="header">
<div class="header-content">
<h2>
Review Bookdrop Files
<a href="https://booklore-app.github.io/booklore-docs/docs/bookdrop" target="_blank" rel="noopener noreferrer">
<i
class="pi pi-external-link text-sky-600 cursor-pointer"
style="font-size: 0.9rem"
class="pi pi-external-link external-link-icon"
pTooltip="View documentation"
tooltipPosition="top"></i>
</a>
</h2>
<p class="text-sm text-gray-400">
<p>
These files were uploaded to the
<strong class="text-[var(--primary-color)]">Bookdrop Folder</strong>.
<strong>Bookdrop Folder</strong>.
Review their fetched metadata, assign a library and subpath, and finalize where they belong in your collection.
</p>
</div>
<div class="mt-4 md:mt-0">
<div class="header-actions">
<p-button
label="Rescan Bookdrop"
icon="pi pi-refresh"
@@ -34,21 +33,21 @@
@if (loading) {
<div class="absolute inset-0 flex items-center justify-center z-50 rounded-xl">
<div class="flex flex-col items-center space-y-3">
<p-progressSpinner class="w-8 h-8" strokeWidth="4"/>
<span class="text-gray-300">Loading Bookdrop files. Please wait...</span>
<div class="loading-overlay">
<div class="loading-content">
<p-progressSpinner strokeWidth="4"/>
<span>Loading Bookdrop files. Please wait...</span>
</div>
</div>
} @else {
<div class="px-6 pb-2">
<div class="controls-section">
@if (saving) {
<div class="absolute inset-0 bg-black bg-opacity-50 flex flex-col items-center justify-center z-50 rounded-xl space-y-3">
<p-progressSpinner class="w-8 h-8" strokeWidth="4"/>
<div class="bg-gray-900/90 px-4 py-2 rounded-md">
<span class="text-sm text-gray-200 text-center">
<div class="saving-overlay">
<p-progressSpinner strokeWidth="4"/>
<div class="saving-message">
<span>
Organizing and moving files to their designated libraries. Please wait...
</span>
</div>
@@ -56,28 +55,26 @@
}
@if (bookdropFileUis.length !== 0) {
<div class="flex justify-between items-center gap-4 px-1">
<div class="controls-row">
<div class="flex gap-4 items-center">
<span class="text-sm text-gray-300 font-medium">Library for All Files:</span>
<div class="default-controls">
<span>Library for All Files:</span>
<p-select
size="small"
[options]="libraryOptions"
optionLabel="label"
optionValue="value"
placeholder="Select Default Library"
class="min-w-[8rem] max-w-[16rem]"
[(ngModel)]="defaultLibraryId">
</p-select>
<span class="text-sm text-gray-300 font-medium">Subpath for All Files:</span>
<span>Subpath for All Files:</span>
<p-select
size="small"
[options]="selectedLibraryPaths"
optionLabel="label"
optionValue="value"
placeholder="Select Default Subpath"
class="min-w-[8rem] max-w-[16rem]"
[(ngModel)]="defaultPathId">
</p-select>
@@ -92,7 +89,7 @@
</p-button>
</div>
<div class="flex gap-4">
<div class="action-buttons">
<p-button
size="small"
outlined
@@ -130,16 +127,16 @@
}
</div>
<div class="flex-1 overflow-y-auto px-4 md:px-6 pt-4 space-y-2 pb-4">
<div class="content-area">
@if (bookdropFileUis.length === 0) {
<div class="h-full w-full flex items-center justify-center text-gray-400 italic py-8">
<div class="empty-state">
No bookdrop files to review.
</div>
} @else {
@for (file of bookdropFileUis; track file) {
<div class="flex flex-col">
<div class="flex items-center gap-4 custom-border rounded-xl px-4 py-2">
<div class="file-item">
<div class="file-row">
<p-checkbox
[binary]="true"
@@ -148,9 +145,8 @@
</p-checkbox>
<i
class="pi pi-circle-fill"
class="pi pi-circle-fill status-indicator"
[ngStyle]="{'color': file.file.fetchedMetadata ? 'green' : 'darkorange'}"
style="font-size: 0.75rem"
pTooltip="{{file.file.fetchedMetadata ? 'Fetched metadata is available.' : 'No fetched metadata available.'}}"
tooltipPosition="top">
</i>
@@ -160,7 +156,7 @@
[src]="file.metadataForm.get('thumbnailUrl')?.value"
alt="Cover"
title="Original cover"
class="w-6 h-8 rounded-sm object-cover cursor-pointer hover:scale-105 hover:shadow-md transition-transform duration-200"
class="cover-image"
(click)="file.showDetails = !file.showDetails"/>
}
@@ -169,20 +165,20 @@
[src]="file.file.fetchedMetadata?.thumbnailUrl"
alt="Fetched Cover"
title="Fetched cover"
class="w-6 h-8 rounded-sm object-cover cursor-pointer hover:scale-105 hover:shadow-md transition-transform duration-200"
class="cover-image"
(click)="file.showDetails = !file.showDetails"/>
}
<div class="flex-1 font-medium text-sm truncate" (click)="file.showDetails = !file.showDetails">
<div class="file-name" (click)="file.showDetails = !file.showDetails">
{{ file.file.fileName }}
</div>
<i
class="pi"
class="pi metadata-status"
[ngClass]="{
'pi-check-circle text-green-500': copiedFlags[file.file.id],
'pi-check-circle text-blue-500': !file.file.fetchedMetadata,
'pi-exclamation-triangle text-red-500': file.file.fetchedMetadata && !copiedFlags[file.file.id]
'pi-check-circle copied': copiedFlags[file.file.id],
'pi-check-circle no-metadata': !file.file.fetchedMetadata,
'pi-exclamation-triangle not-applied': file.file.fetchedMetadata && !copiedFlags[file.file.id]
}"
[pTooltip]="copiedFlags[file.file.id]
? 'Fetched metadata has been applied.'
@@ -198,7 +194,7 @@
optionLabel="label"
optionValue="value"
placeholder="Select Library"
class="min-w-[8rem] max-w-[16rem]"
class="library-select"
[(ngModel)]="file.selectedLibraryId"
(onChange)="onLibraryChange(file)">
</p-select>
@@ -209,7 +205,7 @@
optionLabel="name"
optionValue="id"
placeholder="Select Subpath"
class="min-w-[8rem] max-w-[16rem]"
class="path-select"
appendTo="body"
[(ngModel)]="file.selectedPathId">
</p-select>
@@ -224,7 +220,7 @@
@if (file.showDetails) {
<app-bookdrop-file-metadata-picker-component
class="px-12 py-8 custom-border1"
class="details-section"
[originalMetadata]="file.file.originalMetadata"
[fetchedMetadata]="file.file.fetchedMetadata!"
[metadataForm]="file.metadataForm"
@@ -241,9 +237,9 @@
<p-divider></p-divider>
<div class="pb-2 px-4 flex items-center justify-between gap-4">
<div class="footer">
<div class="flex gap-4 items-center min-w-[160px] justify-start">
<div class="footer-left">
@if (bookdropFileUis.length > 0) {
<p-button
label="Select All"
@@ -265,11 +261,11 @@
tooltipPosition="top">
</p-button>
} @else {
<div class="min-w-[160px]"></div>
<div class="spacer"></div>
}
</div>
<div class="flex-grow flex justify-center">
<div class="footer-center">
<p-paginator
[rows]="pageSize"
[totalRecords]="totalRecords"
@@ -280,7 +276,7 @@
</p-paginator>
</div>
<div class="flex gap-4 items-center min-w-[200px] justify-end">
<div class="footer-right">
<p-button
[label]="'Delete ' + selectedCount + ' File' + (selectedCount !== 1 ? 's' : '')"
icon="pi pi-times"
@@ -1,12 +1,292 @@
.custom-border {
border: 1px solid var(--border-color);
border-radius: 10px 10px 0px 0px;
.container {
overflow-x: auto;
}
.custom-border1 {
.main-card {
display: flex;
flex-direction: column;
height: calc(100dvh - 6.1rem);
border-radius: 0.75rem;
overflow: hidden;
background: var(--card-background);
min-width: 100rem;
border: 1px solid var(--p-content-border-color);
> * + * {
margin: 0.25rem;
}
}
.header {
padding: 1.5rem 1rem 1rem;
display: flex;
flex-direction: column;
border-bottom: 1px solid var(--p-content-border-color);
@media (min-width: 768px) {
padding: 1.5rem 1.5rem 1rem;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
}
.header-content {
h2 {
font-size: 1.25rem;
font-weight: 600;
padding-bottom: 0.25rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
p {
font-size: 0.875rem;
color: rgb(156, 163, 175);
strong {
color: var(--primary-color);
}
}
}
.header-actions {
margin-top: 1rem;
@media (min-width: 768px) {
margin-top: 0;
}
}
.external-link-icon {
color: rgb(2, 132, 199);
cursor: pointer;
font-size: 0.9rem;
}
.loading-overlay {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 50;
border-radius: 0.75rem;
}
.loading-content {
display: flex;
flex-direction: column;
align-items: center;
> * + * {
margin-top: 0.75rem;
}
span {
color: rgb(209, 213, 219);
}
p-progressSpinner {
width: 2rem;
height: 2rem;
}
}
.controls-section {
padding: 0 1.5rem 0.5rem;
}
.saving-overlay {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 50;
border-radius: 0.75rem;
> * + * {
margin-top: 0.75rem;
}
p-progressSpinner {
width: 2rem;
height: 2rem;
}
}
.saving-message {
background: rgba(17, 24, 39, 0.9);
padding: 0.5rem 1rem;
border-radius: 0.375rem;
span {
font-size: 0.875rem;
color: rgb(229, 231, 235);
text-align: center;
}
}
.controls-row {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
padding: 0 0.25rem;
}
.default-controls {
display: flex;
gap: 1rem;
align-items: center;
span {
font-size: 0.875rem;
color: rgb(209, 213, 219);
font-weight: 500;
}
p-select {
min-width: 8rem;
max-width: 16rem;
}
}
.action-buttons {
display: flex;
gap: 1rem;
}
.content-area {
flex: 1;
overflow-y: auto;
padding: 1rem 1rem 1rem;
> * + * {
margin-top: 0.5rem;
}
@media (min-width: 768px) {
padding: 1rem 1.5rem 1rem;
}
}
.empty-state {
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
color: rgb(156, 163, 175);
font-style: italic;
padding: 2rem 0;
}
.file-item {
display: flex;
flex-direction: column;
}
.file-row {
display: flex;
align-items: center;
gap: 1rem;
border: 1px solid var(--border-color);
border-radius: 0.75rem 0.75rem 0 0;
padding: 0.5rem 1rem;
}
.status-indicator {
font-size: 0.75rem;
}
.cover-image {
width: 1.5rem;
height: 2rem;
border-radius: 0.125rem;
object-fit: cover;
cursor: pointer;
transition: transform 0.2s;
&:hover {
transform: scale(1.05);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
}
.file-name {
flex: 1;
font-weight: 500;
font-size: 0.875rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.metadata-status {
&.copied {
color: rgb(34, 197, 94);
}
&.no-metadata {
color: rgb(59, 130, 246);
}
&.not-applied {
color: rgb(239, 68, 68);
}
}
.library-select,
.path-select {
min-width: 8rem;
max-width: 16rem;
}
.details-section {
padding: 2rem 3rem;
border-left: 1px solid var(--border-color);
border-right: 1px solid var(--border-color);
border-bottom: 1px solid var(--border-color);
border-top: none;
border-radius: 0px 0px 10px 10px;
border-radius: 0 0 0.625rem 0.625rem;
}
.footer {
padding: 0.5rem 1rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
}
.footer-left,
.footer-right {
display: flex;
gap: 1rem;
align-items: center;
min-width: 10rem;
}
.footer-left {
justify-content: flex-start;
}
.footer-right {
min-width: 12.5rem;
justify-content: flex-end;
}
.footer-center {
flex-grow: 1;
display: flex;
justify-content: center;
}
.spacer {
min-width: 10rem;
}