refactor(ui): rebrand frontend surfaces to grimmory

- Frontend branding:
  - rename visible Booklore branding in the app shell, document title, page titles, manifest metadata, package metadata, and frontend README
  - update first-party documentation links to the Grimmory docs site
  - rename the Angular workspace project id to `grimmory` while keeping the current output path contract unchanged for now

- Compatibility shims:
  - make Grimmory-first UI state and permission names coexist with the legacy Booklore API payload names
  - add explicit `TODO(grimmory-cleanup)` markers on the temporary language-storage, KOReader, permission, and reset-progress aliases
  - keep legacy endpoint and payload fallbacks in place where the backend still speaks Booklore

- Reader and settings cleanup:
  - rename KOReader toggle state and bulk-reset permission handling in the UI to Grimmory-first identifiers
  - update progress labels and tooltips so the frontend no longer displays Booklore to end users
This commit is contained in:
James Cox
2026-03-20 19:58:03 -05:00
committed by James Cox
parent eb94afa7ad
commit d786dd8ccb
25 changed files with 117 additions and 53 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# BookLore
# Grimmory
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.2.
+3 -3
View File
@@ -3,7 +3,7 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"booklore": {
"grimmory": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
@@ -100,10 +100,10 @@
"builder": "@angular/build:dev-server",
"configurations": {
"production": {
"buildTarget": "booklore:build:production"
"buildTarget": "grimmory:build:production"
},
"development": {
"buildTarget": "booklore:build:development"
"buildTarget": "grimmory:build:development"
}
},
"defaultConfiguration": "development"
+2 -2
View File
@@ -1,11 +1,11 @@
{
"name": "booklore",
"name": "grimmory",
"version": "0.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "booklore",
"name": "grimmory",
"version": "0.0.0",
"dependencies": {
"@angular/animations": "^21.2.4",
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "booklore",
"name": "grimmory",
"version": "0.0.0",
"scripts": {
"ng": "ng",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "booklore",
"short_name": "booklore",
"name": "Grimmory",
"short_name": "Grimmory",
"display": "fullscreen",
"display_override": ["fullscreen", "standalone", "browser"],
"scope": "./",
@@ -3,11 +3,14 @@ import {TranslocoService} from '@jsverse/transloco';
import {firstValueFrom} from 'rxjs';
import {AVAILABLE_LANGS} from './transloco-loader';
export const LANG_STORAGE_KEY = 'booklore-lang';
// TODO(grimmory-cleanup): Remove after the Booklore-to-Grimmory localStorage migration window closes.
export const LEGACY_LANG_STORAGE_KEY = 'booklore-lang';
export const LANG_STORAGE_KEY = 'grimmory-lang';
function detectLanguage(available: string[]): string {
const saved = localStorage.getItem(LANG_STORAGE_KEY);
const saved = localStorage.getItem(LANG_STORAGE_KEY) ?? localStorage.getItem(LEGACY_LANG_STORAGE_KEY);
if (saved && available.includes(saved)) {
localStorage.setItem(LANG_STORAGE_KEY, saved);
return saved;
}
@@ -29,6 +32,7 @@ export function initializeLanguage() {
const translocoService = inject(TranslocoService);
const lang = detectLanguage(AVAILABLE_LANGS);
translocoService.setActiveLang(lang);
localStorage.setItem(LANG_STORAGE_KEY, lang);
return firstValueFrom(translocoService.load(lang));
};
}
@@ -185,7 +185,7 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy {
const progressParts: string[] = [];
if (this._progressPercentage !== null) {
progressParts.push(`${this._progressPercentage}% (BookLore)`);
progressParts.push(`${this._progressPercentage}% (Grimmory)`);
}
if (this._koProgressPercentage !== null) {
progressParts.push(`${this._koProgressPercentage}% (KOReader)`);
@@ -619,7 +619,7 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy {
label: this.t.translate('book.card.menu.resetGrimmoryProgress'),
icon: 'pi pi-undo',
command: () => {
this.bookService.resetProgress(this.book.id, ResetProgressTypes.BOOKLORE).subscribe({
this.bookService.resetProgress(this.book.id, ResetProgressTypes.GRIMMORY).subscribe({
next: () => {
this.messageService.add({
severity: 'success',
@@ -356,7 +356,7 @@ export class BookMenuService {
});
}
if (permissions?.canBulkResetBookloreReadProgress) {
if (permissions?.canBulkResetGrimmoryReadProgress ?? permissions?.canBulkResetBookloreReadProgress) {
items.push({
label: this.t.translate('book.menuService.menu.resetGrimmoryProgress'),
icon: 'pi pi-undo',
@@ -370,7 +370,7 @@ export class BookMenuService {
accept: () => {
const loader = this.loadingService.show(this.t.translate('book.menuService.loading.resettingGrimmoryProgress', {count}));
this.bookService.resetProgress(Array.from(selectedBooks), ResetProgressTypes.BOOKLORE)
this.bookService.resetProgress(Array.from(selectedBooks), ResetProgressTypes.GRIMMORY)
.pipe(finalize(() => this.loadingService.hide(loader)))
.subscribe({
next: () => {
@@ -4,7 +4,7 @@
<div class="header-content">
<h2>
{{ t('title') }}
<a href="https://booklore.org/docs/bookdrop" target="_blank" rel="noopener noreferrer">
<a href="https://grimmory.org/docs/bookdrop" target="_blank" rel="noopener noreferrer">
<i
class="pi pi-external-link external-link-icon"
[pTooltip]="t('viewDocumentationTooltip')"
@@ -415,7 +415,7 @@
severity="danger"
text
class="inline-action-button"
(onClick)="resetProgress(book, ResetProgressTypes.BOOKLORE)">
(onClick)="resetProgress(book, ResetProgressTypes.GRIMMORY)">
</p-button>
}
</span>
@@ -257,7 +257,7 @@ export class ReaderEventService {
}
private injectMobileSelectionStyles(doc: Document): void {
const styleId = 'booklore-mobile-selection-styles';
const styleId = 'grimmory-mobile-selection-styles';
if (doc.getElementById(styleId)) return;
const style = doc.createElement('style');
@@ -51,10 +51,10 @@
<div class="setting-label-row">
<label class="setting-label">{{ t('koreader.syncWithGrimmory') }}</label>
<p-toggle-switch
name="syncWithBookloreReader"
[(ngModel)]="syncWithBookloreReader"
(ngModelChange)="onToggleSyncWithBookloreReader($event)"
inputId="syncWithBookloreReader"
name="syncWithGrimmoryReader"
[(ngModel)]="syncWithGrimmoryReader"
(ngModelChange)="onToggleSyncWithGrimmoryReader($event)"
inputId="syncWithGrimmoryReader"
[disabled]="!credentialsSaved || !koReaderSyncEnabled">
</p-toggle-switch>
</div>
@@ -34,7 +34,7 @@ export class KoreaderSettingsComponent implements OnInit, OnDestroy {
editMode = true;
showPassword = false;
koReaderSyncEnabled = false;
syncWithBookloreReader = false;
syncWithGrimmoryReader = false;
koReaderUsername = '';
koReaderPassword = '';
credentialsSaved = false;
@@ -69,7 +69,7 @@ export class KoreaderSettingsComponent implements OnInit, OnDestroy {
this.koReaderUsername = koreaderUser.username;
this.koReaderPassword = koreaderUser.password;
this.koReaderSyncEnabled = koreaderUser.syncEnabled;
this.syncWithBookloreReader = koreaderUser.syncWithBookloreReader ?? false;
this.syncWithGrimmoryReader = koreaderUser.syncWithGrimmoryReader ?? koreaderUser.syncWithBookloreReader ?? false;
this.credentialsSaved = true;
},
error: err => {
@@ -110,10 +110,10 @@ export class KoreaderSettingsComponent implements OnInit, OnDestroy {
});
}
onToggleSyncWithBookloreReader(enabled: boolean) {
this.koreaderService.toggleSyncProgressWithBookloreReader(enabled).subscribe({
onToggleSyncWithGrimmoryReader(enabled: boolean) {
this.koreaderService.toggleSyncProgressWithGrimmoryReader(enabled).subscribe({
next: () => {
this.syncWithBookloreReader = enabled;
this.syncWithGrimmoryReader = enabled;
this.messageService.add({
severity: 'success',
summary: this.t.translate('settingsDevice.koreader.syncUpdated'),
@@ -2,13 +2,16 @@ import {inject, Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {API_CONFIG} from '../../../../../core/config/api-config';
import {HttpClient} from '@angular/common/http';
import {catchError} from 'rxjs/operators';
export interface KoreaderUser {
username: string;
password: string;
syncEnabled: boolean;
syncWithBookloreReader: boolean;
syncWithGrimmoryReader?: boolean;
// TODO(grimmory-cleanup): Remove once the backend no longer returns the legacy Booklore KOReader sync field.
syncWithBookloreReader?: boolean;
}
@Injectable({
@@ -35,9 +38,14 @@ export class KoreaderService {
});
}
toggleSyncProgressWithBookloreReader(enabled: boolean): Observable<void> {
return this.http.patch<void>(`${this.url}/me/sync-progress-with-booklore`, null, {
toggleSyncProgressWithGrimmoryReader(enabled: boolean): Observable<void> {
return this.http.patch<void>(`${this.url}/me/sync-progress-with-grimmory`, null, {
params: {enabled: enabled.toString()}
});
}).pipe(
// TODO(grimmory-cleanup): Remove the legacy endpoint fallback after all supported backends expose the Grimmory route.
catchError(() => this.http.patch<void>(`${this.url}/me/sync-progress-with-booklore`, null, {
params: {enabled: enabled.toString()}
}))
);
}
}
@@ -434,8 +434,8 @@
</h4>
<div class="permission-group-items">
<div class="permission-item">
<p-checkbox formControlName="permissionBulkResetBookloreReadProgress" [binary]="true" inputId="perm-bulk-reset-booklore"></p-checkbox>
<label for="perm-bulk-reset-booklore" class="permission-label">
<p-checkbox formControlName="permissionBulkResetGrimmoryReadProgress" [binary]="true" inputId="perm-bulk-reset-grimmory"></p-checkbox>
<label for="perm-bulk-reset-grimmory" class="permission-label">
<div class="permission-icon-wrapper">
<i class="pi pi-history permission-icon"></i>
</div>
@@ -75,7 +75,7 @@ export class CreateUserDialogComponent implements OnInit {
permissionBulkRegenerateCover: [false],
permissionMoveOrganizeFiles: [false],
permissionBulkLockUnlockMetadata: [false],
permissionBulkResetBookloreReadProgress: [false],
permissionBulkResetGrimmoryReadProgress: [false],
permissionBulkResetKoReaderReadProgress: [false],
permissionBulkResetBookReadStatus: [false],
}, {validators: [passwordMatchValidator('password', 'confirmPassword')]});
@@ -383,8 +383,8 @@
</h5>
<div class="permission-items">
<div class="permission-item">
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canBulkResetBookloreReadProgress" [disabled]="isPermissionDisabled(user)" inputId="bulkresetbooklore-{{user.id}}"></p-checkbox>
<label [for]="'bulkresetbooklore-'+user.id">{{ t('perms.bulkResetGrimmory') }}</label>
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canBulkResetGrimmoryReadProgress" [disabled]="isPermissionDisabled(user)" inputId="bulkresetgrimmory-{{user.id}}"></p-checkbox>
<label [for]="'bulkresetgrimmory-'+user.id">{{ t('perms.bulkResetGrimmory') }}</label>
</div>
<div class="permission-item">
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canBulkResetKoReaderReadProgress" [disabled]="isPermissionDisabled(user)" inputId="bulkresetkoreader-{{user.id}}"></p-checkbox>
@@ -288,7 +288,7 @@ export class UserManagementComponent implements OnInit, OnDestroy {
getBulkResetPermissionsCount(user: User): number {
const permissions = user.permissions;
let count = 0;
if (permissions.canBulkResetBookloreReadProgress) count++;
if (permissions.canBulkResetGrimmoryReadProgress ?? permissions.canBulkResetBookloreReadProgress) count++;
if (permissions.canBulkResetKoReaderReadProgress) count++;
if (permissions.canBulkResetBookReadStatus) count++;
return count;
@@ -340,6 +340,7 @@ export class UserManagementComponent implements OnInit, OnDestroy {
user.permissions.canBulkRegenerateCover = true;
user.permissions.canMoveOrganizeFiles = true;
user.permissions.canBulkLockUnlockMetadata = true;
user.permissions.canBulkResetGrimmoryReadProgress = true;
user.permissions.canBulkResetBookloreReadProgress = true;
user.permissions.canBulkResetKoReaderReadProgress = true;
user.permissions.canBulkResetBookReadStatus = true;
@@ -3,7 +3,7 @@ import {HttpClient} from '@angular/common/http';
import {BehaviorSubject, Observable, throwError} from 'rxjs';
import {API_CONFIG} from '../../../core/config/api-config';
import {Library} from '../../book/model/library.model';
import {catchError, distinctUntilChanged, finalize, shareReplay, tap} from 'rxjs/operators';
import {catchError, distinctUntilChanged, finalize, map, shareReplay, tap} from 'rxjs/operators';
import {AuthService} from '../../../shared/service/auth.service';
import {DashboardConfig} from '../../dashboard/models/dashboard-config.model';
@@ -320,6 +320,8 @@ export interface User {
canBulkRegenerateCover: boolean;
canMoveOrganizeFiles: boolean;
canBulkLockUnlockMetadata: boolean;
canBulkResetGrimmoryReadProgress?: boolean;
// TODO(grimmory-cleanup): Remove once the backend no longer serves the legacy Booklore permission name.
canBulkResetBookloreReadProgress?: boolean;
canBulkResetKoReaderReadProgress?: boolean;
canBulkResetBookReadStatus?: boolean;
@@ -398,7 +400,7 @@ export class UserService {
private fetchMyself(): Observable<User> {
return this.http.get<User>(`${this.userUrl}/me`).pipe(
tap(user => this.userStateSubject.next({user, loaded: true, error: null})),
tap(user => this.userStateSubject.next({user: this.normalizeUser(user), loaded: true, error: null})),
catchError(err => {
const curr = this.userStateSubject.value;
this.userStateSubject.next({user: curr.user, loaded: true, error: err.message});
@@ -416,19 +418,26 @@ export class UserService {
}
getMyself(): Observable<User> {
return this.http.get<User>(`${this.userUrl}/me`);
return this.http.get<User>(`${this.userUrl}/me`).pipe(
map(user => this.normalizeUser(user)),
tap(user => this.userStateSubject.next({user, loaded: true, error: null}))
);
}
createUser(userData: Omit<User, 'id'>): Observable<void> {
return this.http.post<void>(this.apiUrl, userData);
createUser<T extends Record<string, unknown>>(userData: T): Observable<void> {
return this.http.post<void>(this.apiUrl, this.serializeUserPayload(userData));
}
getUsers(): Observable<User[]> {
return this.http.get<User[]>(this.userUrl);
return this.http.get<User[]>(this.userUrl).pipe(
map(users => users.map(user => this.normalizeUser(user)))
);
}
updateUser(userId: number, updateData: UserUpdateRequest): Observable<User> {
return this.http.put<User>(`${this.userUrl}/${userId}`, updateData);
return this.http.put<User>(`${this.userUrl}/${userId}`, this.serializeUserPayload(updateData)).pipe(
map(user => this.normalizeUser(user))
);
}
deleteUser(userId: number): Observable<void> {
@@ -478,4 +487,45 @@ export class UserService {
}
});
}
private normalizeUser(user: User): User {
const permissions = user.permissions;
return {
...user,
permissions: {
...permissions,
canBulkResetGrimmoryReadProgress: permissions.canBulkResetGrimmoryReadProgress ?? permissions.canBulkResetBookloreReadProgress,
canBulkResetBookloreReadProgress: permissions.canBulkResetBookloreReadProgress ?? permissions.canBulkResetGrimmoryReadProgress,
}
};
}
private serializeUserPayload<T extends Record<string, unknown>>(payload: T): T {
const nextPayload: Record<string, unknown> = {...payload};
if ('permissions' in payload && payload.permissions && typeof payload.permissions === 'object') {
const permissions = payload.permissions as User['permissions'];
// TODO(grimmory-cleanup): Drop the legacy Booklore permission alias after the backend accepts only Grimmory names.
const canBulkResetReadProgress =
permissions.canBulkResetGrimmoryReadProgress ?? permissions.canBulkResetBookloreReadProgress;
nextPayload.permissions = {
...permissions,
canBulkResetGrimmoryReadProgress: canBulkResetReadProgress,
canBulkResetBookloreReadProgress: canBulkResetReadProgress,
};
}
if ('permissionBulkResetGrimmoryReadProgress' in payload || 'permissionBulkResetBookloreReadProgress' in payload) {
// TODO(grimmory-cleanup): Drop the flat Booklore form field alias after the create-user API accepts only Grimmory names.
const canBulkResetReadProgress =
(payload.permissionBulkResetGrimmoryReadProgress as boolean | undefined)
?? (payload.permissionBulkResetBookloreReadProgress as boolean | undefined);
nextPayload.permissionBulkResetGrimmoryReadProgress = canBulkResetReadProgress;
nextPayload.permissionBulkResetBookloreReadProgress = canBulkResetReadProgress;
}
return nextPayload as T;
}
}
@@ -25,7 +25,7 @@ export type DocType = 'kobo' | 'opds' | 'metadataManager' | 'koReader' | 'email'
`]
})
export class ExternalDocLinkComponent {
private readonly BASE_URL = 'https://booklore.org/docs';
private readonly BASE_URL = 'https://grimmory.org/docs';
private readonly DOC_URLS: Record<DocType, string> = {
kobo: `${this.BASE_URL}/integration/kobo`,
@@ -1,6 +1,7 @@
export const ResetProgressTypes = {
KOREADER: 'KOREADER',
BOOKLORE: 'BOOKLORE',
// TODO(grimmory-cleanup): Switch backend/API payloads to emit a real GRIMMORY reset type and drop the BOOKLORE alias.
GRIMMORY: 'BOOKLORE',
KOBO: 'KOBO'
} as const;
@@ -10,8 +10,8 @@
fill="white"/>
</svg>
<span class="logo-text-wrapper">
<p>Book</p>
<p class="half-title logo-text-lore">lore</p>
<p>Grimm</p>
<p class="half-title logo-text-mark">ory</p>
</span>
</a>
@@ -145,7 +145,7 @@
<div class="topbar-action-group">
<li>
<a class="topbar-item"
href="https://booklore.org/docs/getting-started"
href="https://grimmory.org/docs/getting-started"
target="_blank"
rel="noopener noreferrer"
[pTooltip]="t('documentation')"
@@ -265,7 +265,7 @@
<li>
<a
class="mobile-menu-item"
href="https://booklore.org/docs/getting-started"
href="https://grimmory.org/docs/getting-started"
target="_blank"
rel="noopener noreferrer">
<i class="pi pi-info-circle topbar-icon"></i>
@@ -19,7 +19,7 @@
}
}
.logo-text-lore {
.logo-text-mark {
font-size: 1.875rem;
line-height: 2.25rem;
}
@@ -6,7 +6,7 @@ import {Book} from "../../features/book/model/book.model";
export class PageTitleService {
protected titleService = inject(Title)
private appName = 'BookLore'
private appName = 'Grimmory'
setBookPageTitle(book: Book) {
const title = [
+1 -1
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>BookLore</title>
<title>Grimmory</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover">
<link rel="icon" type="image/svg+xml" href="assets/favicon.svg"/>