Repository navigation
fix(ui): keep a podcast header's cover at the left on phones - #508
Merged
Merged
Conversation
Fails on master: under a rule that centers images, as on the phone in #506, the cover moves off the left edge, and the drawer's search row is drawn in background-primary instead of the drawer's color.
The hero's text block didn't take the rest of its row, so a theme or snippet that gives images auto inline margins centered the cover in the leftover space and pushed the title to the right edge. The text now takes the row, as in every other cover row. In a mobile drawer, the view's page color is the drawer's own --mobile-sidebar-background, so the sticky search row no longer shows as a darker or lighter band.
Switching through app.changeTheme wrote app.json and raced the harness's config restore. The test now sets the theme class, measures, and puts the class and the centering rule back in one evaluation.
In a mobile drawer the mini player does not stand out from the page, so the drawer rule gets its own comment.
A cover that fell back to its text tile would dodge the image rule and let the test pass without the bug's conditions.
Deploying podnotes with
|
| Latest commit: |
683e49f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://eb6e45e2.podnotes.pages.dev |
| Branch Preview URL: | https://fix-phone-podcast-header.podnotes.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #506
On a phone, a podcast's page could show its cover far from the left edge, with the title and author pushed against the right edge. In the header, the text block took only its own width, so the row had free space left over. A theme or snippet that gives images auto side margins (
img { margin-inline: auto }, a common way to center images) put the cover in the middle of that space. Every other cover row in the view already lets its text take the rest of the row.flex: 1). No free space is left, so auto margins on the cover come to 0, even when they are!important.--mobile-sidebar-background. Before, the sticky search row and the full player used--background-primary, so on a phone in dark mode they were black on the drawer's #1e1e1e. With Minimal they were a lighter band, as in the owner's screenshot.Obsidian's and PodNotes' own CSS do not reproduce the header bug. Chromium phone emulation and WebKit 26.4 (rendering the live markup and CSS) both lay out the header correctly, and so does Minimal 9.1.4 in Chromium with all 261 of its body-class toggles on. The owner's drawer and band colors match Minimal exactly (#212121 and #262626), and Minimal plus any image-centering rule reproduces the owner's layout to the pixel. I could not see which rule on the owner's phone centers images, so the fix does not depend on which one it is.
Left out: in a dark drawer the mini player has the drawer's color and stands apart only by its top border. This was already so on master.
The row menu icon is horizontal in the "before" shots and vertical in the "after" shots. Obsidian chose its "more" icon differently in the two sessions, and its own view-header button changed the same way. This PR does not change it.
Verification
Obsidian 1.14.4 on Linux (Xvfb), isolated worktree vault, phone emulation (390 x 844,
body.is-phone), view in the right drawer (328 px). Node 22.23.2.on a phone, a podcast's header keeps its cover at the left under a theme that centers images, ...intests/e2e/view-polish.test.ts. It addsimg { margin-inline: auto !important }and checks the header and the search row in the right drawer and the main area, dark and light. Red on master: the cover sits 60 px in (91 px in the main area), and the dark drawer's search row isrgb(0, 0, 0)onrgb(30, 30, 30). Green with the fix.npm run test:e2eon a fresh vault withview-polish,journey-feeds,journey-links-localandjourney-shell: 4 files, 34 tests passed at 26eba28. The later commits change only the new test and a comment, and the new test passes again.npm run lint,format:check,typecheck,build,test(2788 passed),docs:build: all pass.npm run size: 101,611 gzip bytes (master 101,597, +14; budget 103,000).Mutations. Each one is a plausible wrong fix, and each fails the new e2e:
margin: 0on the cover instead offlex: 1on the textflex: 1on the title instead of the text blockjustify-content: flex-starton the header--background-secondaryrgb(246, 246, 246)on white.is-mobileinstead of the drawerrgb(30, 30, 30)on blackRelease impact
None. CSS only, with no settings, storage, API or URI change.
Docs at release
None.
Note
Low Risk
CSS-only layout and theme-token tweaks with no API or data changes; risk is limited to podcast page header and mobile drawer styling.
Overview
Fixes phone podcast page layout when themes center images (#506) by giving the hero text block
flex: 1, so the row has no spare width formargin-inline: autoon the cover to shift it away from the left.In a mobile workspace drawer,
--pn-bgnow uses--mobile-sidebar-backgroundinstead of the main-area primary background, so the sticky episode search row (and related surfaces) match the drawer in dark and light mode.Adds an e2e test that injects centered-image CSS on phone and asserts cover/title spacing plus filter-row vs page background colors in the right drawer and main area.
Reviewed by Cursor Bugbot for commit 683e49f. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix podcast header cover alignment and background on phones
Macroscope summarized 683e49f.