Skip to content

Commit 07b19f0

Browse files
chore: update version to 4.8.2 and document bug fixes in changelog
* Update version in manifest and package files to 4.8.2 * Add changelog entry for version 4.8.2 * Document fix for page view alignment when sticky is disabled
1 parent b413f8d commit 07b19f0

6 files changed

Lines changed: 34 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. See [standa
44

55
## 4.X
66

7+
### [4.8.2](https://github.com/SkepticMystic/breadcrumbs/compare/4.8.1...4.8.2) (2026-05-03)
8+
9+
### Bug Fixes
10+
11+
* Fix page view alignment when sticky is disabled and readable line length is enabled
12+
713
### [4.8.1](https://github.com/SkepticMystic/breadcrumbs/compare/4.8.0...4.8.1) (2026-05-02)
814

915
### Features

manifest-beta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "breadcrumbs",
33
"name": "Breadcrumbs",
4-
"version": "4.8.1",
4+
"version": "4.8.2",
55
"minAppVersion": "1.12.0",
66
"description": "Add structured hierarchies to your notes",
77
"author": "SkepticMystic",

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "breadcrumbs",
33
"name": "Breadcrumbs",
4-
"version": "4.8.1",
4+
"version": "4.8.2",
55
"minAppVersion": "1.12.0",
66
"description": "Add structured hierarchies to your notes",
77
"author": "SkepticMystic",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "breadcrumbs",
3-
"version": "4.8.1",
3+
"version": "4.8.2",
44
"description": "Add typed-links to your Obsidian notes",
55
"main": "main.js",
66
"scripts": {

src/views/page.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function redraw_page_views(plugin: BreadcrumbsPlugin) {
1919

2020
// Ensure the container exists _on the current page_, leaving other pages' containers alone
2121
const page_views_el =
22-
markdown_view.containerEl.querySelector(".BC-page-views") ??
22+
markdown_view.containerEl.querySelector<HTMLElement>(".BC-page-views") ??
2323
markdown_view.containerEl.createDiv({
2424
cls: "BC-page-views w-full mx-auto",
2525
});
@@ -56,6 +56,9 @@ export function redraw_page_views(plugin: BreadcrumbsPlugin) {
5656

5757
view_parent.insertBefore(page_views_el, view_parent.firstChild);
5858

59+
page_views_el.style.removeProperty("margin-left");
60+
page_views_el.style.removeProperty("margin-right");
61+
5962
// Source mode may have left these on .cm-scroller in older versions.
6063
const preview_scroller = markdown_view.containerEl.querySelector(
6164
".cm-scroller",
@@ -101,6 +104,8 @@ export function redraw_page_views(plugin: BreadcrumbsPlugin) {
101104
}
102105
host.insertBefore(page_views_el, cm_scroller);
103106
}
107+
page_views_el.style.removeProperty("margin-left");
108+
page_views_el.style.removeProperty("margin-right");
104109
} else {
105110
// Inside the scroller so the trail scrolls with the note; layout class wraps a full-width row.
106111
// Insert as the first child so BC-page-views occupies row 1 (flex: 0 0 100%),
@@ -110,6 +115,23 @@ export function redraw_page_views(plugin: BreadcrumbsPlugin) {
110115
page_views_el,
111116
cm_scroller.firstChild,
112117
);
118+
119+
// Obsidian centers text via .cm-sizer (max-width + margin:auto), so text
120+
// starts at (scroller_w - file_line_w) / 2 + gutter_w. Shift BC's
121+
// margin-left by the gutter width to match.
122+
if (plugin.settings.views.page.all.readable_line_width) {
123+
requestAnimationFrame(() => {
124+
if (!page_views_el.isConnected) return;
125+
const gutters =
126+
cm_scroller.querySelector<HTMLElement>(".cm-gutters");
127+
const G = gutters?.getBoundingClientRect().width ?? 0;
128+
page_views_el.style.marginLeft = `calc((100% - var(--file-line-width)) / 2 + ${G}px)`;
129+
page_views_el.style.marginRight = "auto";
130+
});
131+
} else {
132+
page_views_el.style.removeProperty("margin-left");
133+
page_views_el.style.removeProperty("margin-right");
134+
}
113135
}
114136
}
115137

versions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,5 +264,6 @@
264264
"4.7.3-beta": "1.12.0",
265265
"4.8.0": "1.12.0",
266266
"4.8.1-beta": "1.12.0",
267-
"4.8.1": "1.12.0"
267+
"4.8.1": "1.12.0",
268+
"4.8.2": "1.12.0"
268269
}

0 commit comments

Comments
 (0)