Remove Tailwind CSS and all remaining references (#2413)

Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
ACX
2026-01-22 23:41:57 -07:00
committed by acx10
co-authored by acx10
parent 5d9e535a14
commit a0870cac86
104 changed files with 2852 additions and 1333 deletions
@@ -25,24 +25,24 @@
optionLabel="label"
optionValue="value"
placeholder="Select file type"
class="w-full"
styleClass="full-width"
[disabled]="isUploading"
></p-select>
<!-- Description Field -->
<div class="w-full">
<label for="description" class="block text-sm font-medium mb-2">Description (Optional)</label>
<div class="description-field">
<label for="description" class="description-label">Description (Optional)</label>
<p-textarea
[(ngModel)]="description"
rows="3"
placeholder="Add a description for this file..."
class="w-full"
styleClass="full-width"
[disabled]="isUploading"
></p-textarea>
</div>
<!-- File Upload -->
<p-fileupload class="w-full" name="file"
<p-fileupload class="file-upload" name="file"
[maxFileSize]="maxFileSizeBytes"
[customUpload]="true"
[multiple]="false"
@@ -50,8 +50,8 @@
(uploadHandler)="uploadFiles($event)"
[disabled]="isUploading">
<ng-template #header let-files let-chooseCallback="chooseCallback" let-clearCallback="clearCallback" let-uploadCallback="uploadCallback">
<div class="flex flex-wrap items-center justify-center flex-1 gap-4">
<div class="flex gap-4">
<div class="upload-header-actions">
<div class="action-buttons">
<p-button (onClick)="choose($event, chooseCallback)"
icon="pi pi-images"
[rounded]="true"
@@ -73,19 +73,19 @@
</div>
</ng-template>
<ng-template #content let-files let-removeFileCallback="removeFileCallback">
<div class="flex flex-col gap-8 px-4">
<div class="upload-content">
@if (files?.length > 0) {
<div>
<div class="max-h-96 max-w-[22rem] md:max-w-none overflow-y-auto pr-2">
<div class="flex flex-wrap">
<div class="file-list-scroll">
<div class="file-list">
@for (uploadFile of this.files; track uploadFile; let i = $index) {
<div class="flex justify-between items-center w-full gap-4">
<div class="flex items-center gap-4 overflow-hidden flex-1">
<p-badge [value]="uploadFile.status" [severity]="getBadgeSeverity(uploadFile.status)" class="shrink-0"/>
<span class="font-semibold text-ellipsis whitespace-nowrap overflow-hidden flex-1">
<div class="file-row">
<div class="file-info">
<p-badge [value]="uploadFile.status" [severity]="getBadgeSeverity(uploadFile.status)" class="file-badge"/>
<span class="file-name">
{{ uploadFile.file.name }}
</span>
<div class="shrink-0">{{ formatSize(uploadFile.file.size) }}</div>
<div class="file-size">{{ formatSize(uploadFile.file.size) }}</div>
</div>
@switch (uploadFile.status) {
@case ('Pending') {
@@ -97,7 +97,7 @@
}
@case ('Uploading') {
<i
class="pi pi-spin pi-spinner p-3"
class="pi pi-spin pi-spinner status-icon"
style="color: slateblue"
pTooltip="Uploading"
tooltipPosition="top">
@@ -105,7 +105,7 @@
}
@case ('Uploaded') {
<i
class="pi pi-check p-3"
class="pi pi-check status-icon"
style="color: green"
pTooltip="Uploaded"
tooltipPosition="top">
@@ -113,7 +113,7 @@
}
@case ('Failed') {
<i
class="pi pi-exclamation-triangle p-3"
class="pi pi-exclamation-triangle status-icon"
style="color: darkred"
pTooltip="{{ uploadFile.errorMessage || 'Upload failed' }}"
tooltipPosition="top">
@@ -130,14 +130,14 @@
</ng-template>
<ng-template #file></ng-template>
<ng-template #empty>
<div class="flex items-center justify-center flex-col text-center">
<i class="pi pi-cloud-upload !border-2 !rounded-full !p-8 !text-4xl !text-muted-color"></i>
<p class="mt-6 mb-2">Drag and drop a file here to upload.</p>
<p class="mt-2 mb-2">
<div class="empty-state">
<i class="pi pi-cloud-upload empty-icon"></i>
<p class="empty-text">Drag and drop a file here to upload.</p>
<p class="empty-subtext">
Upload an additional file for <strong>{{ book.metadata?.title || 'this book' }}</strong>.
</p>
</div>
</ng-template>
</p-fileupload>
</div>
</div>
</div>
@@ -26,6 +26,126 @@
gap: 1.5rem;
}
:host ::ng-deep .p-fileupload-content p-progressbar {
display: none !important;
:host ::ng-deep {
.p-fileupload-content p-progressbar {
display: none !important;
}
.full-width {
width: 100%;
}
}
.file-upload {
width: 100%;
}
.description-field {
width: 100%;
}
.description-label {
display: block;
font-size: 0.875rem;
font-weight: 500;
margin-bottom: 0.5rem;
}
.upload-header-actions {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
flex: 1;
gap: 1rem;
}
.action-buttons {
display: flex;
gap: 1rem;
}
.upload-content {
display: flex;
flex-direction: column;
gap: 2rem;
padding: 0 1rem;
}
.file-list-scroll {
max-height: 24rem;
max-width: 22rem;
overflow-y: auto;
padding-right: 0.5rem;
@media (min-width: 768px) {
max-width: none;
}
}
.file-list {
display: flex;
flex-wrap: wrap;
}
.file-row {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
gap: 1rem;
}
.file-info {
display: flex;
align-items: center;
gap: 1rem;
overflow: hidden;
flex: 1;
}
.file-badge {
flex-shrink: 0;
}
.file-name {
font-weight: 600;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
flex: 1;
}
.file-size {
flex-shrink: 0;
}
.status-icon {
padding: 0.75rem;
}
.empty-state {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
text-align: center;
}
.empty-icon {
border: 2px solid;
border-radius: 9999px;
padding: 2rem;
font-size: 2.25rem;
color: var(--p-text-muted-color);
}
.empty-text {
margin-top: 1.5rem;
margin-bottom: 0.5rem;
}
.empty-subtext {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
@@ -81,7 +81,7 @@
</div>
@if (!bottomBarHidden) {
<div class="book-title-container flex items-center">
<div class="book-title-container">
@if (_shouldShowStatusIcon) {
<div class="read-status-indicator"
[ngClass]="_readStatusClass"
@@ -90,7 +90,7 @@
<i [class]="_readStatusIcon" style="font-size: 0.9rem"></i>
</div>
}
<h4 class="book-title m-0 pl-2"
<h4 class="book-title"
tooltipPosition="bottom"
[pTooltip]="titleTooltip">
{{ displayTitle }}
@@ -65,6 +65,8 @@
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
margin: 0;
padding-left: 0.5rem;
}
.info-btn,
@@ -24,7 +24,7 @@
<p-tableHeaderCheckbox/>
</th>
<th></th>
<th class="max-w-14 min-w-14"></th>
<th class="cover-header-cell"></th>
@for (col of visibleColumns; track col.field) {
<th pResizableColumn>{{ col.header }}</th>
}
@@ -37,7 +37,7 @@
<td>
<p-tableCheckbox [value]="book"/>
</td>
<td class="text-center">
<td class="cell-center">
<p-button
[icon]="isMetadataFullyLocked(metadata) ? 'pi pi-lock' : 'pi pi-lock-open'"
[severity]="isMetadataFullyLocked(metadata) ? 'danger' : 'success'"
@@ -53,27 +53,27 @@
<img
[attr.src]="urlHelper.getThumbnailUrl(metadata.bookId, metadata.coverUpdatedOn)"
alt="Book Cover"
class="size-7"
class="cover-thumbnail"
tooltipPosition="left"
[pTooltip]="tooltipContent"
tooltipStyleClass="[&>.p-tooltip-text]:p-1"
tooltipStyleClass="cover-tooltip"
/>
</a>
<ng-template #tooltipContent>
<div class="flex flex-col items-center gap-2">
<div class="tooltip-cover-container">
<img
[attr.src]="urlHelper.getThumbnailUrl(metadata.bookId, metadata.coverUpdatedOn)"
alt="Book Cover"
class="w-[40rem] h-auto"
class="tooltip-cover-image"
/>
<em class="text-sm text-balance text-center">{{ metadata.title }}</em>
<em class="tooltip-cover-title">{{ metadata.title }}</em>
</div>
</ng-template>
</td>
@for (col of visibleColumns; track col.field) {
@if (col.field === 'readStatus') {
<td class="text-center min-w-[4rem] max-w-[4rem]">
<td class="cell-status">
@if (shouldShowStatusIcon(book.readStatus)) {
<div class="read-status-indicator"
[ngClass]="getReadStatusClass(book.readStatus)"
@@ -84,8 +84,8 @@
}
</td>
} @else if (col.field === 'amazonRating' || col.field === 'goodreadsRating' || col.field === 'hardcoverRating' || col.field == 'ranobedbRating') {
<td class="min-w-[10rem] max-w-[10rem] overflow-hidden truncate">
<span class="flex items-center gap-1">
<td class="cell-rating">
<span class="rating-wrapper">
<p-rating
[(ngModel)]="metadata[col.field]"
readonly
@@ -100,10 +100,10 @@
} @else {
<td
[title]="getCellValue(metadata, book, col.field)"
class="overflow-hidden truncate text-right min-w-[6rem] max-w-[12rem]">
class="cell-text">
@if(['title', 'authors', 'publisher', 'seriesName', 'categories', 'language'].includes(col.field)) {
@for (item of getCellClickableValue(metadata, book, col.field); track $index; let isLast = $last) {
<a [routerLink]="item.url" class="hover:underline hover:text-blue-400">
<a [routerLink]="item.url" class="cell-link">
{{ item.anchor }}</a>@if (!isLast) {<span>, </span>}
}
} @else {
@@ -36,3 +36,75 @@
.status-wont-read {
color: #ec4899;
}
.cover-header-cell {
max-width: 3.5rem;
min-width: 3.5rem;
}
.cell-center {
text-align: center;
}
.cover-thumbnail {
width: 1.75rem;
height: 1.75rem;
}
.tooltip-cover-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
}
.tooltip-cover-image {
width: 40rem;
height: auto;
}
.tooltip-cover-title {
font-size: 0.875rem;
text-wrap: balance;
text-align: center;
}
.cell-status {
text-align: center;
min-width: 4rem;
max-width: 4rem;
}
.cell-rating {
min-width: 10rem;
max-width: 10rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.rating-wrapper {
display: flex;
align-items: center;
gap: 0.25rem;
}
.cell-text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: right;
min-width: 6rem;
max-width: 12rem;
}
.cell-link {
&:hover {
text-decoration: underline;
color: #60a5fa;
}
}
::ng-deep .cover-tooltip > .p-tooltip-text {
padding: 0.25rem;
}
@@ -1,4 +1,4 @@
import {beforeEach, describe, expect, it, vi} from 'vitest';
import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
import {TestBed} from '@angular/core/testing';
import {EnvironmentInjector, runInInjectionContext} from '@angular/core';
import {CoverScalePreferenceService} from './cover-scale-preference.service';
@@ -1,106 +0,0 @@
import {describe, expect, it, vi} from 'vitest';
import {FilterLabelHelper} from './filter-label.helper';
vi.mock('./book-filter/book-filter.component', () => ({
fileSizeRanges: [
{id: 'small', label: 'Small Files'},
{id: 'large', label: 'Large Files'}
],
pageCountRanges: [
{id: 'short', label: 'Short Books'},
{id: 'long', label: 'Long Books'}
],
matchScoreRanges: [
{id: 'high', label: 'High Match'},
{id: 'low', label: 'Low Match'}
],
ratingOptions10: [
{id: '5', label: 'Five Stars'},
{id: '10', label: 'Ten Stars'}
],
ratingRanges: [
{id: 'A', label: 'A Range'},
{id: 'B', label: 'B Range'}
]
}));
describe('FilterLabelHelper', () => {
describe('getFilterTypeName', () => {
it('should return mapped label for known filter type', () => {
expect(FilterLabelHelper.getFilterTypeName('author')).toBe('Author');
expect(FilterLabelHelper.getFilterTypeName('category')).toBe('Genre');
expect(FilterLabelHelper.getFilterTypeName('series')).toBe('Series');
});
it('should capitalize and return unknown filter type', () => {
expect(FilterLabelHelper.getFilterTypeName('unknownType')).toBe('UnknownType');
expect(FilterLabelHelper.getFilterTypeName('custom')).toBe('Custom');
});
});
describe('getFilterDisplayValue', () => {
it('should return file size label for known id', () => {
expect(FilterLabelHelper.getFilterDisplayValue('fileSize', 'small')).toBe('small');
expect(FilterLabelHelper.getFilterDisplayValue('filesize', 'large')).toBe('large');
});
it('should return value if file size id not found', () => {
expect(FilterLabelHelper.getFilterDisplayValue('fileSize', 'unknown')).toBe('unknown');
});
it('should return page count label for known id', () => {
expect(FilterLabelHelper.getFilterDisplayValue('pageCount', 'short')).toBe('short');
expect(FilterLabelHelper.getFilterDisplayValue('pagecount', 'long')).toBe('long');
});
it('should return value if page count id not found', () => {
expect(FilterLabelHelper.getFilterDisplayValue('pageCount', 'unknown')).toBe('unknown');
});
it('should return match score label for known id', () => {
expect(FilterLabelHelper.getFilterDisplayValue('matchScore', 'high')).toBe('high');
expect(FilterLabelHelper.getFilterDisplayValue('matchscore', 'low')).toBe('low');
});
it('should return value if match score id not found', () => {
expect(FilterLabelHelper.getFilterDisplayValue('matchScore', 'unknown')).toBe('unknown');
});
it('should return personal rating label for known id', () => {
expect(FilterLabelHelper.getFilterDisplayValue('personalRating', '5')).toBe('5');
expect(FilterLabelHelper.getFilterDisplayValue('personalrating', '10')).toBe('10');
});
it('should return value if personal rating id not found', () => {
expect(FilterLabelHelper.getFilterDisplayValue('personalRating', 'unknown')).toBe('unknown');
});
it('should return rating range label for amazon/goodreads/hardcover', () => {
expect(FilterLabelHelper.getFilterDisplayValue('amazonRating', 'A')).toBe('A');
expect(FilterLabelHelper.getFilterDisplayValue('goodreadsRating', 'B')).toBe('B');
expect(FilterLabelHelper.getFilterDisplayValue('hardcoverRating', 'A')).toBe('A');
});
it('should return value if rating range id not found', () => {
expect(FilterLabelHelper.getFilterDisplayValue('amazonRating', 'unknown')).toBe('unknown');
expect(FilterLabelHelper.getFilterDisplayValue('goodreadsRating', 'unknown')).toBe('unknown');
expect(FilterLabelHelper.getFilterDisplayValue('hardcoverRating', 'unknown')).toBe('unknown');
});
it('should return value for unknown filter type', () => {
expect(FilterLabelHelper.getFilterDisplayValue('unknownType', 'someValue')).toBe('someValue');
});
});
describe('capitalize', () => {
it('should capitalize the first letter', () => {
// @ts-expect-private
// @ts-ignore
expect(FilterLabelHelper.capitalize('test')).toBe('Test');
// @ts-ignore
expect(FilterLabelHelper.capitalize('T')).toBe('T');
// @ts-ignore
expect(FilterLabelHelper.capitalize('')).toBe('');
});
});
});
@@ -18,10 +18,10 @@
</div>
<div class="dialog-content">
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-x-24 gap-y-4">
<div class="fields-grid">
@for (field of lockableFields; track field) {
<div class="flex items-center justify-between">
<label class="capitalize">{{ fieldLabels[field] || field }}</label>
<div class="field-row">
<label class="field-label">{{ fieldLabels[field] || field }}</label>
<p-button
[outlined]="true"
[label]="getLockLabel(field)"
@@ -26,3 +26,28 @@
gap: 0.5rem;
align-items: center;
}
.fields-grid {
display: grid;
grid-template-columns: repeat(1, minmax(0, 1fr));
column-gap: 6rem;
row-gap: 1rem;
@media (min-width: 576px) {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 768px) {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
.field-row {
display: flex;
align-items: center;
justify-content: space-between;
}
.field-label {
text-transform: capitalize;
}
@@ -1,12 +1,12 @@
<div class="book-notes-container">
<div class="notes-content">
@if (loading) {
<div class="flex flex-col items-center justify-center p-8 gap-4">
<div class="loading-state">
<p-progressSpinner/>
<span class="text-gray-400">Loading notes...</span>
<span class="loading-text">Loading notes...</span>
</div>
} @else if (notes.length === 0) {
<div class="text-center p-8 text-gray-400 empty-state">
<div class="empty-state">
<div class="empty-state-icon">
<p-button
outlined
@@ -19,8 +19,8 @@
class="action-btn floating-btn">
</p-button>
</div>
<p class="text-gray-200 empty-state-title">No notes yet for this book</p>
<p class="text-sm text-gray-400 mt-2 empty-state-subtitle">
<p class="empty-state-title">No notes yet for this book</p>
<p class="empty-state-subtitle">
Click "Add Note" to create your first note and start capturing your thoughts
</p>
<div class="empty-state-decoration"></div>
@@ -29,14 +29,14 @@
<div class="notes-scroll-container">
<div class="notes-horizontal-list">
@for (note of notes; track note.id + '-' + note.createdAt + '-' + $index) {
<div class="note-card border border-zinc-700">
<div class="note-card">
<div class="note-header">
<div class="flex justify-between items-start p-3">
<div class="flex flex-col gap-1">
<h4 class="note-title font-medium text-lg text-gray-200 m-0">{{ note.title }}</h4>
<div class="note-header-inner">
<div class="note-title-group">
<h4 class="note-title">{{ note.title }}</h4>
<div class="note-meta">
<i class="pi pi-clock text-xs mr-1"></i>
<span class="text-sm text-gray-400">
<i class="pi pi-clock note-meta-icon"></i>
<span class="note-meta-text">
@if (note.createdAt !== note.updatedAt) {
Updated {{ formatDate(note.updatedAt) }}
} @else {
@@ -71,8 +71,8 @@
</div>
</div>
<div class="note-content-area px-3 pb-3">
<div class="text-zinc-300 note-body">{{ note.content }}</div>
<div class="note-content-area">
<div class="note-body">{{ note.content }}</div>
<div class="note-fade-overlay"></div>
</div>
<div class="note-bottom-glow"></div>
@@ -104,34 +104,34 @@
[closable]="true"
[dismissableMask]="true">
<div class="flex flex-col gap-4">
<div class="dialog-form">
<div class="field">
<label for="create-title" class="block text-sm font-medium mb-2">Title</label>
<label for="create-title" class="field-label">Title</label>
<input
id="create-title"
pInputText
[(ngModel)]="newNote.title"
placeholder="Enter note title"
class="w-full"
class="field-input"
maxlength="255"/>
</div>
<div class="field">
<label for="create-content" class="block text-sm font-medium mb-2">Content</label>
<label for="create-content" class="field-label">Content</label>
<textarea
id="create-content"
pTextarea
[(ngModel)]="newNote.content"
placeholder="Enter your note content..."
[rows]="8"
class="w-full"
class="field-input"
[autoResize]="true">
</textarea>
</div>
</div>
<ng-template #footer>
<div class="flex gap-2 justify-end">
<div class="dialog-actions">
<p-button
label="Cancel"
severity="secondary"
@@ -157,34 +157,34 @@
[closable]="true"
[dismissableMask]="true">
<div class="flex flex-col gap-4">
<div class="dialog-form">
<div class="field">
<label for="edit-title" class="block text-sm font-medium mb-2">Title</label>
<label for="edit-title" class="field-label">Title</label>
<input
id="edit-title"
pInputText
[(ngModel)]="editNote.title"
placeholder="Enter note title"
class="w-full"
class="field-input"
maxlength="255"/>
</div>
<div class="field">
<label for="edit-content" class="block text-sm font-medium mb-2">Content</label>
<label for="edit-content" class="field-label">Content</label>
<textarea
id="edit-content"
pTextarea
[(ngModel)]="editNote.content"
placeholder="Enter your note content..."
[rows]="8"
class="w-full"
class="field-input"
[autoResize]="true">
</textarea>
</div>
</div>
<ng-template #footer>
<div class="flex gap-2 justify-end">
<div class="dialog-actions">
<p-button
label="Cancel"
severity="secondary"
@@ -20,21 +20,39 @@
}
}
.loading-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2rem;
gap: 1rem;
}
.loading-text {
color: #9ca3af;
}
.empty-state {
position: relative;
padding: 3rem !important;
text-align: center;
color: #9ca3af;
.empty-state-title {
font-size: 1.25rem;
font-weight: 600;
margin-top: 1rem;
margin-bottom: 0.5rem;
color: #e5e7eb;
}
.empty-state-subtitle {
max-width: 400px;
margin: 0 auto;
margin: 0.5rem auto 0;
line-height: 1.6;
font-size: 0.875rem;
color: #9ca3af;
}
.empty-state-decoration {
@@ -85,7 +103,6 @@
border: 1px solid var(--p-content-border-color);
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
@media (max-width: 768px) {
width: 340px;
height: 220px;
@@ -116,6 +133,19 @@
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
position: relative;
.note-header-inner {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 0.75rem;
}
.note-title-group {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.note-title {
max-width: 350px;
white-space: nowrap;
@@ -125,6 +155,9 @@
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
font-weight: 500;
font-size: 1.125rem;
margin: 0;
@media (max-width: 768px) {
max-width: 200px;
@@ -147,6 +180,16 @@
}
}
.note-meta-icon {
font-size: 0.75rem;
margin-right: 0.25rem;
}
.note-meta-text {
font-size: 0.875rem;
color: #9ca3af;
}
.note-actions {
display: flex;
gap: 0.5rem;
@@ -174,7 +217,7 @@
display: flex;
flex-direction: column;
position: relative;
padding: 1rem !important;
padding: 1rem;
.note-fade-overlay {
position: absolute;
@@ -233,6 +276,29 @@
}
}
.dialog-form {
display: flex;
flex-direction: column;
gap: 1rem;
}
.field-label {
display: block;
font-size: 0.875rem;
font-weight: 500;
margin-bottom: 0.5rem;
}
.field-input {
width: 100%;
}
.dialog-actions {
display: flex;
gap: 0.5rem;
justify-content: flex-end;
}
@keyframes float {
0%, 100% {
transform: translateY(0px);
@@ -1,12 +1,12 @@
<div class="book-reviews-container">
<div class="reviews-content">
@if (loading) {
<div class="flex flex-col items-center justify-center p-8 gap-4">
<div class="loading-state">
<p-progressSpinner/>
<span class="text-gray-400">Getting latest reviews...</span>
<span class="loading-text">Getting latest reviews...</span>
</div>
} @else if (reviews?.length === 0) {
<div class="text-center p-8 text-gray-400 empty-state">
<div class="empty-state">
<div class="empty-state-icon">
@if (hasPermission && !reviewsLocked && reviewDownloadEnabled) {
<p-button
@@ -21,13 +21,13 @@
</p-button>
}
</div>
<p class="text-gray-200 empty-state-title">No reviews available for this book</p>
<p class="empty-state-title">No reviews available for this book</p>
@if (!reviewDownloadEnabled) {
<p class="text-sm text-amber-400 mt-2 empty-state-subtitle">
<p class="empty-state-subtitle empty-state-subtitle--warning">
Book review downloads are currently disabled. Enable this in Metadata Settings to fetch reviews.
</p>
} @else if (hasPermission && !reviewsLocked) {
<p class="text-sm text-gray-400 mt-2 empty-state-subtitle">
<p class="empty-state-subtitle">
Click "Fetch Reviews" to download reviews from configured providers
</p>
}
@@ -37,7 +37,7 @@
<div class="reviews-scroll-container">
<div class="reviews-horizontal-list">
@for (review of reviews; track review.id || $index) {
<div [class]="'review-card border border-zinc-700' + (!review.title ? ' no-title' : '') + (review.spoiler && !isSpoilerRevealed(review.id!) ? ' has-spoiler' : '')">
<div [class]="'review-card' + (!review.title ? ' no-title' : '') + (review.spoiler && !isSpoilerRevealed(review.id!) ? ' has-spoiler' : '')">
@if (review.spoiler && !isSpoilerRevealed(review.id!)) {
<p-button
label="Show Spoiler"
@@ -49,10 +49,10 @@
}
<div class="review-header">
<div class="flex justify-between items-start p-3">
<div class="flex flex-col gap-1">
<div class="flex items-center gap-2">
<span class="font-medium text-sm reviewer-name">{{ review.reviewerName || 'Anonymous' }}</span>
<div class="review-header-inner">
<div class="reviewer-info-group">
<div class="reviewer-name-row">
<span class="reviewer-name">{{ review.reviewerName || 'Anonymous' }}</span>
@if (review.metadataProvider) {
<p-tag
[rounded]="true"
@@ -67,28 +67,28 @@
}
</div>
<div class="review-meta">
<i class="pi pi-clock text-xs mr-1"></i>
<i class="pi pi-clock review-meta-icon"></i>
@if (review.date) {
<span class="text-sm text-gray-400">{{ formatDate(review.date) }}</span>
<span class="review-meta-text">{{ formatDate(review.date) }}</span>
}
</div>
</div>
<div class="flex items-center gap-2">
<div class="review-actions">
@if (review.rating) {
<div class="flex items-center gap-1">
<div class="rating-wrapper">
<p-rating
[ngModel]="review.rating"
[readonly]="true"
[stars]="5"/>
<span class="text-sm font-medium">{{ review.rating }}/5</span>
<span class="rating-text">{{ review.rating }}/5</span>
</div>
}
@if (hasPermission) {
@if (reviewsLocked) {
<div class="flex items-center justify-center w-8 h-8">
<i class="pi pi-lock text-amber-500 text-sm"
<div class="lock-icon-container">
<i class="pi pi-lock lock-icon"
pTooltip="Reviews are locked"
tooltipPosition="top"></i>
</div>
@@ -110,7 +110,7 @@
@if (review.title && (!review.spoiler || isSpoilerRevealed(review.id!))) {
<div class="review-title-section">
<h4 class="font-medium text-xl text-gray-200 leading-tight m-0 review-title"
<h4 class="review-title"
[pTooltip]="review.title"
tooltipPosition="top">{{ review.title }}
</h4>
@@ -121,19 +121,19 @@
@if (review.spoiler && !isSpoilerRevealed(review.id!)) {
<div class="spoiler-blur-content">
@if (review.title) {
<h4 class="font-medium text-gray-200 leading-tight m-0 review-title blur-sm mb-2">{{ review.title }}</h4>
<h4 class="review-title review-title--blurred">{{ review.title }}</h4>
}
@if (review.body) {
<div class="text-zinc-300 review-body blur-sm">{{ review.body }}</div>
<div class="review-body review-body--blurred">{{ review.body }}</div>
} @else {
<div class="text-zinc-400 italic text-sm blur-sm">No review content available</div>
<div class="review-empty-text review-empty-text--blurred">No review content available</div>
}
</div>
} @else {
@if (review.body) {
<div class="text-zinc-300 review-body">{{ review.body }}</div>
<div class="review-body">{{ review.body }}</div>
} @else {
<div class="text-zinc-400 italic text-sm">No review content available</div>
<div class="review-empty-text">No review content available</div>
}
}
<div class="review-fade-overlay"></div>
@@ -54,21 +54,43 @@
}
}
.loading-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2rem;
gap: 1rem;
}
.loading-text {
color: #9ca3af;
}
.empty-state {
position: relative;
padding: 3rem !important;
text-align: center;
color: #9ca3af;
.empty-state-title {
font-size: 1.25rem;
font-weight: 600;
margin-top: 1rem;
margin-bottom: 0.5rem;
color: #e5e7eb;
}
.empty-state-subtitle {
max-width: 400px;
margin: 0 auto;
margin: 0.5rem auto 0;
line-height: 1.6;
font-size: 0.875rem;
color: #9ca3af;
&--warning {
color: #fbbf24;
}
}
.empty-state-decoration {
@@ -177,6 +199,25 @@
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
position: relative;
.review-header-inner {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 0.75rem;
}
.reviewer-info-group {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.reviewer-name-row {
display: flex;
align-items: center;
gap: 0.5rem;
}
.reviewer-name {
max-width: 120px;
white-space: nowrap;
@@ -186,6 +227,8 @@
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
font-weight: 500;
font-size: 0.875rem;
}
.review-meta {
@@ -198,6 +241,46 @@
}
}
.review-meta-icon {
font-size: 0.75rem;
margin-right: 0.25rem;
}
.review-meta-text {
font-size: 0.875rem;
color: #9ca3af;
}
.review-actions {
display: flex;
align-items: center;
gap: 0.5rem;
}
.rating-wrapper {
display: flex;
align-items: center;
gap: 0.25rem;
}
.rating-text {
font-size: 0.875rem;
font-weight: 500;
}
.lock-icon-container {
display: flex;
align-items: center;
justify-content: center;
width: 2rem;
height: 2rem;
}
.lock-icon {
color: #f59e0b;
font-size: 0.875rem;
}
.action-btn-hover {
opacity: 0.7;
transition: all 0.3s ease;
@@ -248,6 +331,24 @@
}
}
.review-title {
max-width: 450px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: help;
font-weight: 500;
font-size: 1.25rem;
color: #e5e7eb;
line-height: 1.25;
margin: 0;
&--blurred {
filter: blur(4px);
margin-bottom: 0.5rem;
}
}
.review-body {
flex: 1;
min-height: 0;
@@ -256,6 +357,11 @@
word-wrap: break-word;
white-space: pre-wrap;
box-sizing: border-box;
color: #d4d4d8;
&--blurred {
filter: blur(4px);
}
&::-webkit-scrollbar {
width: 4px;
@@ -276,10 +382,21 @@
}
}
.review-title {
max-width: 450px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: help;
.review-empty-text {
color: #a1a1aa;
font-style: italic;
font-size: 0.875rem;
&--blurred {
filter: blur(4px);
}
}
@keyframes float {
0%, 100% {
transform: translateY(0px);
}
50% {
transform: translateY(-10px);
}
}
@@ -18,21 +18,21 @@
</div>
<div class="dialog-content">
<div class="flex flex-col gap-6">
<div class="flex flex-col gap-2">
<label class="text-sm font-medium text-gray-300">Email Provider</label>
<div class="form-fields">
<div class="form-field">
<label class="field-label">Email Provider</label>
<p-select
[options]="emailProviders"
optionLabel="label"
placeholder="Select Email Provider"
[(ngModel)]="selectedProvider"
appendTo="body"
class="w-full">
styleClass="full-width">
</p-select>
</div>
<div class="flex flex-col gap-2">
<label class="text-sm font-medium text-gray-300">Recipient</label>
<div class="form-field">
<label class="field-label">Recipient</label>
<p-select
[options]="emailRecipients"
optionLabel="label"
@@ -40,7 +40,7 @@
[(ngModel)]="selectedRecipient"
[disabled]="!selectedProvider"
appendTo="body"
class="w-full">
styleClass="full-width">
</p-select>
</div>
</div>
@@ -24,3 +24,25 @@
.dialog-footer {
@include panel.dialog-footer;
}
.form-fields {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.form-field {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.field-label {
font-size: 0.875rem;
font-weight: 500;
color: #d1d5db;
}
:host ::ng-deep .full-width {
width: 100%;
}
@@ -1,5 +1,5 @@
@if (filteredBooks$ | async; as books) {
<div class="relative rounded-xl overflow-hidden border-[1px] border-solid border-[var(--p-content-border-color)]">
<div class="series-wrapper">
<p-tabs [value]="tab" lazy="true" scrollable>
<p-tablist>
<p-tab value="view">
@@ -7,26 +7,25 @@
Series Details
</p-tab>
</p-tablist>
<p-tabpanels class="tabpanels-responsive overflow-auto">
<p-tabpanels class="tabpanels-responsive">
<p-tabpanel value="view">
@if (books[0]; as firstBook) {
<div class="flex flex-col justify-between flex-grow">
<div class="space-y-4 ">
<div class="series-main">
<div class="series-details">
<!-- <div class="flex items-start justify-between"> -->
<div class="flex flex-col text-center gap-4 md:text-left w-full">
<div class="series-info-section">
<div class="flex flex-col items-center md:items-start gap-1">
<div class="flex items-center gap-2 justify-center md:justify-start flex-wrap text-center md:text-left">
<h2 class="text-2xl md:text-3xl font-extrabold leading-tight">
<div class="series-title-block">
<div class="series-title-row">
<h2 class="series-title">
{{ seriesTitle$ | async }}
</h2>
</div>
<p class="text-lg">
<p class="series-authors">
@for (author of firstBook.metadata?.authors; track $index; let isLast = $last) {
<a class="hover:underline dark:text-blue-400 cursor-pointer" (click)="goToAuthorBooks(author)">
<a class="author-link" (click)="goToAuthorBooks(author)">
{{ author }}
</a>
@if (!isLast) {
@@ -34,27 +33,25 @@
}
}
</p>
<!-- </div> -->
</div>
@if (firstBook.metadata?.categories?.length) {
<div class="overflow-x-auto scrollbar-hide max-w-7xl pt-2 md:pt-0">
<div class="flex gap-2 w-max max-w-[1150px]">
<div class="categories-scroll">
<div class="categories-list">
@for (category of firstBook.metadata?.categories; track category) {
<a (click)="goToCategory(category)" class="shrink-0 no-underline cursor-pointer">
<a (click)="goToCategory(category)" class="category-link">
<p-tag [value]="category"></p-tag>
</a>
}
</div>
</div>
}
<div class="px-1 md:px-0">
<div
class="grid md:grid-cols-5 p-3 gap-y-2.5 text-sm pt-2 md:pt-4 pb-2 text-gray-300 md:min-w-[60rem] md:max-w-[100rem]">
<div class="metadata-section-padding">
<div class="metadata-grid">
<p>
<span class="font-bold">Publisher: </span>
<span class="metadata-label">Publisher: </span>
@if (firstBook.metadata?.publisher; as publisher) {
<span class="underline hover:opacity-80 cursor-pointer" (click)="goToPublisher(publisher)">
<span class="publisher-link" (click)="goToPublisher(publisher)">
{{publisher}}
</span>
} @else {
@@ -66,7 +63,7 @@
<p><strong>Language:</strong> {{ firstBook.metadata?.language || "-"}}</p>
<p><strong>Read Status: </strong>
@let s = seriesReadStatus$ | async;
<span class="inline-block px-2 py-0.5 rounded-full text-xs font-bold text-white"
<span class="status-badge"
[ngClass]="getStatusSeverityClass(s || 'UNREAD')">
{{ getStatusLabel(s) }}
@if (s === 'PARTIALLY_READ') {
@@ -78,10 +75,10 @@
</div>
<!-- DESCRIPTION -->
<div class="px-4 pb-2 pt-4 mb-4 md:mb-6 md:mx-2 border border-[var(--border-color)] rounded-xl">
<div class="description-box">
<div [ngClass]="{ 'line-clamp-5': !isExpanded, 'line-clamp-none': isExpanded }"
class="transition-all duration-300 overflow-hidden description-container">
<div class="readonly-editor px-2"
class="description-container">
<div class="readonly-editor"
[innerHTML]="(firstDescription$ | async) || 'No description available.'"></div>
</div>
@let desc = firstDescription$ | async;
@@ -93,7 +90,7 @@
}
</div>
<div class="grid series-items-grid overflow-y-auto" #Container
<div class="series-items-grid" #Container
[ngStyle]="{'grid-template-columns': 'repeat(auto-fill, minmax(' + gridColumnMinWidth + ', 1fr))'}">
@for (book of books; track book; let i = $index) {
<div class="grid-item"
@@ -125,17 +122,17 @@
</p-tabs>
@if (selectedBooks.size > 0) {
@if (userService.userState$ | async; as userState) {
<div class="book-browser-footer bg-[var(--card-background)] bg-opacity-10" [@slideInOut]>
<div class="flex items-center">
<div class="flex items-center pl-2 w-1/4">
<div class="selected-count-badge text-zinc-200">
<i class="pi pi-check-circle mr-2"></i>
<span class="font-bold text-base" style="color: var(--primary-color)">{{ selectedBooks.size }}</span>
<span class="ml-1">selected</span>
<div class="book-browser-footer" [@slideInOut]>
<div class="footer-inner">
<div class="footer-left">
<div class="selected-count-badge">
<i class="pi pi-check-circle badge-icon"></i>
<span class="badge-count" style="color: var(--primary-color)">{{ selectedBooks.size }}</span>
<span class="badge-label">selected</span>
</div>
</div>
<div class="flex justify-center w-2/4">
<div class="flex gap-2 md:gap-6">
<div class="footer-center">
<div class="footer-action-group">
@if (hasMetadataMenuItems) {
<p-tieredMenu #menu [model]="metadataMenuItems" [popup]="true" appendTo="body"/>
<p-button
@@ -176,7 +173,7 @@
</p-button>
}
@if (hasBulkReadActionsItems) {
<div class="card flex justify-center">
<div class="more-actions-wrapper">
<p-button
(click)="menu.toggle($event)"
pTooltip="More actions"
@@ -190,7 +187,7 @@
}
</div>
<p-divider layout="vertical"></p-divider>
<div class="flex gap-2 md:gap-6">
<div class="footer-action-group">
<p-button
outlined="true"
icon="pi pi-check-square"
@@ -220,7 +217,7 @@
</p-button>
}
</div>
<div class="w-1/4"></div>
<div class="footer-right"></div>
</div>
</div>
}
@@ -228,11 +225,11 @@
</div>
} @else {
<div class="flex flex-col justify-center items-center h-full gap-4">
<div class="loading-state">
<p-progressSpinner strokeWidth="4" fill="transparent" animationDuration=".8s">
</p-progressSpinner>
<p style="color: var(--primary-color);">
Loading series details...
</p>
</div>
}
}
@@ -1,5 +1,6 @@
.tabpanels-responsive {
height: calc(100dvh - 9.7rem);
overflow: auto;
}
@media (max-width: 768px) {
@@ -8,12 +9,205 @@
}
}
.grid {
.series-wrapper {
position: relative;
border-radius: 0.75rem;
overflow: hidden;
border: 1px solid var(--p-content-border-color);
}
.series-main {
display: flex;
flex-direction: column;
justify-content: space-between;
flex-grow: 1;
}
.series-details {
> * + * {
margin-top: 1rem;
}
}
.series-info-section {
display: flex;
flex-direction: column;
text-align: center;
gap: 1rem;
width: 100%;
@media (min-width: 768px) {
text-align: left;
}
}
.series-title-block {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.25rem;
@media (min-width: 768px) {
align-items: flex-start;
}
}
.series-title-row {
display: flex;
align-items: center;
gap: 0.5rem;
justify-content: center;
flex-wrap: wrap;
text-align: center;
@media (min-width: 768px) {
justify-content: flex-start;
text-align: left;
}
}
.series-title {
font-size: 1.5rem;
font-weight: 800;
line-height: 1.25;
@media (min-width: 768px) {
font-size: 1.875rem;
}
}
.series-authors {
font-size: 1.125rem;
}
.author-link {
cursor: pointer;
color: #60a5fa;
&:hover {
text-decoration: underline;
}
}
.categories-scroll {
overflow-x: auto;
max-width: 80rem;
padding-top: 0.5rem;
@media (min-width: 768px) {
padding-top: 0;
}
}
.categories-list {
display: flex;
gap: 0.5rem;
width: max-content;
max-width: 1150px;
}
.category-link {
flex-shrink: 0;
text-decoration: none;
cursor: pointer;
}
.metadata-section-padding {
padding: 0 0.25rem;
@media (min-width: 768px) {
padding: 0;
}
}
.metadata-grid {
display: grid;
padding: 0.75rem;
row-gap: 0.625rem;
font-size: 0.875rem;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: #d1d5db;
@media (min-width: 768px) {
grid-template-columns: repeat(5, minmax(0, 1fr));
padding-top: 1rem;
min-width: 60rem;
max-width: 100rem;
}
}
.metadata-label {
font-weight: 700;
}
.publisher-link {
text-decoration: underline;
cursor: pointer;
&:hover {
opacity: 0.8;
}
}
.status-badge {
display: inline-block;
padding: 0.5rem 0.125rem;
border-radius: 9999px;
font-size: 0.75rem;
font-weight: 700;
color: white;
}
.description-box {
padding: 1rem 1rem 0.5rem;
margin-bottom: 1rem;
border: 1px solid var(--border-color);
border-radius: 0.75rem;
@media (min-width: 768px) {
margin-bottom: 1.5rem;
margin-left: 0.5rem;
margin-right: 0.5rem;
}
}
.description-container {
transition: all 0.3s;
overflow: hidden;
}
.line-clamp-5 {
display: -webkit-box;
-webkit-line-clamp: 5;
-webkit-box-orient: vertical;
overflow: hidden;
}
.line-clamp-none {
-webkit-line-clamp: unset;
}
.readonly-editor {
padding: 0 0.5rem;
}
.series-items-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(1px, 1fr));
gap: 1.3rem;
align-items: start;
width: 100%;
overflow-y: auto;
}
.loading-state {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
gap: 1rem;
}
.book-browser-footer {
@@ -28,23 +222,72 @@
border-radius: 10px 10px 0 0;
border: 1px solid rgba(255, 255, 255, 0.5);
border-width: 1px 1px 0px 1px;
background-color: var(--card-background);
background-color: color-mix(in srgb, var(--card-background), transparent 90%);
}
> .flex {
width: 100%;
.footer-inner {
display: flex;
align-items: center;
width: 100%;
}
.footer-left {
display: flex;
align-items: center;
padding-left: 0.5rem;
width: 25%;
}
.footer-center {
display: flex;
justify-content: center;
width: 50%;
}
.footer-right {
width: 25%;
}
.footer-action-group {
display: flex;
gap: 0.5rem;
@media (min-width: 768px) {
gap: 1.5rem;
}
}
.more-actions-wrapper {
display: flex;
justify-content: center;
}
.selected-count-badge {
display: inline-flex;
align-items: center;
padding: 0.5rem 1rem;
font-size: 0.9rem;
color: #e4e4e7;
i {
font-size: 1rem;
}
}
.badge-icon {
margin-right: 0.5rem;
}
.badge-count {
font-weight: 700;
font-size: 1rem;
}
.badge-label {
margin-left: 0.25rem;
}
@media (max-width: 768px) {
.book-browser-footer {
left: 0%;
@@ -59,4 +302,4 @@
font-size: 0.9rem;
}
}
}
}