mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-21 15:36:18 -05:00
ui: stop /archives/settings wrapping itself in a second PageContainer
`ArchiveRoute` wraps its `<Routes>` in a PageContainer, and `ArchiveSettingsPage` wrapped itself in another. PageContainer carries `margin-top: 1em` and `padding: 1em`, so that page sat 1em lower and 1em further in on all four sides than /archives/domains beside it -- which is exactly what "seems to have more margin" was. It is a fragment now, so its panels are blocks of the route's own stack. Guarded by a source scan rather than a render, since a doubled margin throws nothing: it takes each PageContainer that wraps a router, reads the components it routes to, and fails if one of them renders a PageContainer of its own. The first version of that scan passed against the live bug. It looked at only the first `<PageContainer>` in a file, and in Archive.js that is the offender itself, whose block holds no `<Routes>` -- so the file was skipped before the route wrapper 400 lines below was reached. It reads every occurrence now, and the premise assertions count both the wrappers found and the routes within them. Two more top-level blocks gave up margins that were being added to the page's gap, both headers "matching" each other's pattern: the domain filter row (35.2px against 17.6px) and the channel filter row. /archives/settings and /archives/domains now measure identically -- tab bar bottom at 136.8px, first block 17.6px below it, content inset 17.6px -- as do the statistics and settings pages of every other tab group. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
52ae95ff47
commit
85eeb1cd8d
3 changed files with 97 additions and 6 deletions
|
|
@ -498,8 +498,9 @@ export function DomainsPage() {
|
|||
}
|
||||
}, {enableOnFormTags: false});
|
||||
|
||||
// Header section matching ChannelsPage pattern
|
||||
const header = <div style={{marginBottom: '1em', display: 'flex', flexWrap: 'wrap', gap: '1em', alignItems: 'center'}}>
|
||||
// Header section matching ChannelsPage pattern. No `marginBottom`: this is a top-level block
|
||||
// of the page, and the page's stack spaces it -- its own margin was added to that gap.
|
||||
const header = <div style={{display: 'flex', flexWrap: 'wrap', gap: '1em', alignItems: 'center'}}>
|
||||
<div style={{flex: '1 1 240px'}}>
|
||||
<SearchInput
|
||||
placeholder='Domain filter...'
|
||||
|
|
@ -987,7 +988,13 @@ function ArchiveSettingsPage() {
|
|||
onClick={() => navigator.clipboard.writeText('url')}
|
||||
/>;
|
||||
|
||||
return <PageContainer>
|
||||
/*
|
||||
* A fragment, not a `PageContainer`. `ArchiveRoute` already wraps its `<Routes>` in one, and
|
||||
* a second applies its `margin-top: 1em` and `padding: 1em` again -- so this page sat 1em
|
||||
* lower and 1em further in on all four sides than /archives/domains beside it. As a fragment
|
||||
* these panels become blocks of the route's own page stack, which spaces them.
|
||||
*/
|
||||
return <>
|
||||
<Panel>
|
||||
<Header as='h3'>Archive Downloader Config</Header>
|
||||
|
||||
|
|
@ -1081,7 +1088,7 @@ function ArchiveSettingsPage() {
|
|||
action={urlFieldNameClipboardButton}
|
||||
/>
|
||||
</Panel>
|
||||
</PageContainer>
|
||||
</>
|
||||
}
|
||||
|
||||
function ArchivesPage() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue