From 8cbf1e527a2538f98541a8b818a8d29e8516c830 Mon Sep 17 00:00:00 2001 From: agatha Date: Sat, 9 May 2026 21:24:44 +0000 Subject: [PATCH] Fix: React to external URL changes and cap tag-row height in library Clicking the Reactbin home link (or any navigation to / that removes ?page=) now resets the displayed page by subscribing to queryParamMap for post-init URL changes. Cards with many tags no longer push the pagination bar down since the tag row is clamped to one line. Co-Authored-By: Claude Sonnet 4.6 --- ui/src/app/library/library.component.spec.ts | 8 +++---- ui/src/app/library/library.component.ts | 22 +++++++++++++++++--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/ui/src/app/library/library.component.spec.ts b/ui/src/app/library/library.component.spec.ts index b52868f..9485c60 100644 --- a/ui/src/app/library/library.component.spec.ts +++ b/ui/src/app/library/library.component.spec.ts @@ -8,12 +8,10 @@ import { ImageService } from '../services/image.service'; import { routes } from '../app.routes'; function makeActivatedRoute(queryParams: Record = {}) { + const paramMap = { get: (key: string) => queryParams[key] ?? null }; return { - snapshot: { - queryParamMap: { - get: (key: string) => queryParams[key] ?? null, - }, - }, + snapshot: { queryParamMap: paramMap }, + queryParamMap: of(paramMap), }; } diff --git a/ui/src/app/library/library.component.ts b/ui/src/app/library/library.component.ts index b987847..b1ecd74 100644 --- a/ui/src/app/library/library.component.ts +++ b/ui/src/app/library/library.component.ts @@ -6,7 +6,7 @@ import { } from '@angular/core'; import { CommonModule } from '@angular/common'; import { Router, RouterLink, ActivatedRoute } from '@angular/router'; -import { Subject, debounceTime, distinctUntilChanged, share, timer } from 'rxjs'; +import { Subject, debounceTime, distinctUntilChanged, share, skip, timer } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { ImageRecord, ImageService } from '../services/image.service'; import { TagService } from '../services/tag.service'; @@ -21,7 +21,7 @@ const PLACEHOLDER_SVG = `data:image/svg+xml,
-

Reactbin

+

Reactbin

Browse tags @@ -118,7 +118,8 @@ const PLACEHOLDER_SVG = `data:image/svg+xml,