fix(authors): prevent author header from shrinking in scroll container

Prevent the author header section from compressing or disappearing when
displaying large lists or grids of books on the author detail view.

Closes #737
This commit is contained in:
neon
2026-07-22 05:00:06 +00:00
parent ac129ce754
commit daed7d8fa7
2 changed files with 25 additions and 1 deletions
@@ -0,0 +1,24 @@
import { describe, expect, it } from 'vitest'
import { mount } from '@vue/test-utils'
import type { AuthorDetail } from '@bookorbit/types'
import AuthorHeader from './AuthorHeader.vue'
const author: AuthorDetail = {
id: 7,
name: 'Author',
sortName: null,
description: null,
imageUrl: null,
bookCount: 24,
lastAddedAt: '2026-01-01T00:00:00.000Z',
}
describe('AuthorHeader', () => {
it('does not shrink when the book list exceeds the scroll viewport', () => {
const wrapper = mount(AuthorHeader, {
props: { author },
})
expect(wrapper.get('section').classes()).toContain('shrink-0')
})
})
@@ -72,7 +72,7 @@ watch(resolvedBio, () => {
</script>
<template>
<section class="overflow-hidden rounded-lg border border-border/70 bg-card/80">
<section class="shrink-0 overflow-hidden rounded-lg border border-border/70 bg-card/80">
<div class="bg-gradient-to-b from-primary/8 via-background/0 to-transparent p-4">
<div class="flex flex-col gap-4 lg:flex-row lg:items-start">
<div