From 65b158f7024156fab19a8ec49e7ee2504fe1adf1 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 28 Apr 2026 08:13:49 +0200 Subject: [PATCH] =?UTF-8?q?v0.11.7=20=E2=80=94=20Default=20tab=20=E2=86=92?= =?UTF-8?q?=20Sources,=20fix=20sort-reset=20flipping=20to=20ascending=20on?= =?UTF-8?q?=20reload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two small UX defaults that were quietly wrong: 1. Default tab on first load was Measures; switching to Sources. The highest-leverage entry point for someone documenting an unfamiliar PBIP is "where does this data come from?" — Measures is one click away. Three call sites updated (initial declaration + initial switchTab + reload switchTab). 2. Reload no longer flips Measures/Columns to ascending sort. The cross-report state-reset at __loadBrowserData was setting desc:false while preserving the key, so the initial-load default (usageCount desc) flipped on every report swap. Now explicitly re-applies the same {key:"usageCount",desc:true} both at module init and on reload. Tests: 276/276 unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) --- CHANGELOG.md | 1 + changelog/0.11.7.md | 14 ++++++++++++++ changelog/README.md | 1 + package.json | 2 +- readme.md | 2 +- src/client/main.ts | 13 +++++++++---- 6 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 changelog/0.11.7.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 285a66e..7d994f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ See [`changelog/README.md`](changelog/README.md) for the full index. ## Latest releases +- **[0.11.7](changelog/0.11.7.md)** — 2026-04-28 · Default tab is now Sources (was Measures); fix Measures + Columns flipping to ascending sort on report reload - **[0.11.6](changelog/0.11.6.md)** — 2026-04-26 · Cross-doc link integrity — fix `[Sources.md](#)` regression in Model.md §3.3 + Index.md glossary entries now link to their companion docs (Measures, DataDictionary, Functions, CalcGroups) - **[0.11.5](changelog/0.11.5.md)** — 2026-04-26 · Improvements audit names the entities — tables / measures / columns missing descriptions now list the actual offenders inline - **[0.11.3](changelog/0.11.3.md)** — 2026-04-26 · Mobile responsive — landing + tabs + primary tabs cleaned up for phone viewports; sample loads cleanly from a LinkedIn-arriving mobile click diff --git a/changelog/0.11.7.md b/changelog/0.11.7.md new file mode 100644 index 0000000..eed330d --- /dev/null +++ b/changelog/0.11.7.md @@ -0,0 +1,14 @@ +## [0.11.7] — 2026-04-28 · Default tab → Sources, fix sort-reset on reload + +Two small UX defaults that were quietly wrong. + +### Changed +- **Default tab on first load is now Sources** (was Measures). Sources is the highest-leverage entry point for someone documenting an unfamiliar PBIP — it answers "where does this data come from?" before "what calculations does it do?". Measures is one click away. +- **`switchTab("sources")` on report reload** — was previously `switchTab("measures")`, so swapping reports always dropped you on Measures regardless of the initial-load default. + +### Fixed +- **Reload no longer flips Measures + Columns to ascending sort.** The cross-report state-reset at `__loadBrowserData` was setting `desc: false` while preserving the sort key — so the initial-load default (`usageCount` descending: busiest measures first) flipped to ascending on every report swap. Now explicitly re-applies `{ key: "usageCount", desc: true }` for both measures and columns on reload, matching the initial render. + +### Notes +- Sort default for Measures and Columns has always been "Used (desc)" on first load — this release just makes reload behave the same way. +- No new tests; the bug was in initial-state setup, not in any pure function. diff --git a/changelog/README.md b/changelog/README.md index 95530d8..db96e17 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -11,6 +11,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); version | Version | Date | Theme | |---|---|---| +| [0.11.7](0.11.7.md) | 2026-04-28 | Default tab → Sources; fix Measures + Columns flipping to ascending sort on report reload | | [0.11.6](0.11.6.md) | 2026-04-26 | Cross-doc link integrity — fix `[Sources.md](#)` regression in Model.md §3.3 + wire Index.md entries through `xref()` so glossary terms link to their companion docs | | [0.11.5](0.11.5.md) | 2026-04-26 | Improvements: tables / measures / columns lacking descriptions now list the actual offenders inline (was: count + percentage only) | | [0.11.3](0.11.3.md) | 2026-04-26 | Mobile responsive — landing card + tabs row + primary tabs + modals clean up at ≤720 / ≤480 | diff --git a/package.json b/package.json index ead4e80..e30926e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "powerbi-lineage", - "version": "0.11.6", + "version": "0.11.7", "description": "Generate documentation from Power BI PBIP projects — runs in your browser (nothing uploaded) or as a local CLI. Outputs a searchable dashboard plus 9+ Markdown docs ready for ADO Wiki or GitHub.", "license": "MIT", "author": "Jonathan Papworth", diff --git a/readme.md b/readme.md index 7be84e5..3bbc112 100644 --- a/readme.md +++ b/readme.md @@ -255,4 +255,4 @@ Every anchor link is verified by `tests/md-anchors.test.ts` — drift fires CI. [`changelog/`](changelog/) — one file per release. Full index in [`changelog/README.md`](changelog/README.md). Future direction is open-ended; feature requests welcome via Issues. -Latest release: **[v0.11.6](changelog/0.11.6.md)** — Cross-doc link integrity. Fixes a stale `[Sources.md](#)` link in Model.md §3.3 and wires every Index.md glossary entry through `xref()` so terms link straight to their companion docs (Measures, Data Dictionary, Functions, Calc Groups). Eight new "no empty-fragment link" tests close the regression class. +Latest release: **[v0.11.7](changelog/0.11.7.md)** — Default tab on first load is now **Sources** (was Measures), and Measures + Columns sort no longer flips to ascending on report reload. Small UX defaults that were quietly wrong. diff --git a/src/client/main.ts b/src/client/main.ts index 3e9cc00..d1f48e4 100644 --- a/src/client/main.ts +++ b/src/client/main.ts @@ -180,7 +180,7 @@ function addCopyButtons(){ }); })(); -let activeTab="measures",lastTab="measures"; +let activeTab="sources",lastTab="sources"; // Typed as Record so dynamic key access (e.g. // sortState[t] where t is a string) type-checks. Runtime keys // are still only "measures" / "columns" but a string-key index @@ -2109,7 +2109,7 @@ function downloadMarkdown(){ setTimeout(function(){URL.revokeObjectURL(url);},1000); } -renderSummary();renderTabs();renderMeasures();renderColumns();renderTables();renderRelationships();renderSources();renderSourceMap();renderSourcesViewToggle();renderFunctions();renderCalcGroups();renderPages();renderUnused();renderDocs();refreshMdTabVisibility();switchTab("measures");addCopyButtons(); +renderSummary();renderTabs();renderMeasures();renderColumns();renderTables();renderRelationships();renderSources();renderSourceMap();renderSourcesViewToggle();renderFunctions();renderCalcGroups();renderPages();renderUnused();renderDocs();refreshMdTabVisibility();switchTab("sources");addCopyButtons(); // ───────────────────────────────────────────────────────────────────── // Print support — Ctrl-P produces a PDF covering every tab. @@ -2199,7 +2199,12 @@ function __loadBrowserData(opts: { // "Ghost", giving the impression the dashboard was broken. for (const k of Object.keys(searchTerms)) searchTerms[k] = ""; for (const k of Object.keys(showUnusedOnly)) showUnusedOnly[k] = false; - for (const k of Object.keys(sortState)) sortState[k] = { key: sortState[k].key, desc: false }; + // Reload should land on the same sort the initial render uses — + // usage-count descending so the busiest measures / columns are at + // the top. Flipping desc:false here used to send the user to a + // bottom-up view on every report swap. + sortState.measures = { key: "usageCount", desc: true }; + sortState.columns = { key: "usageCount", desc: true }; openPages.clear(); openTables.clear(); showAutoDate = false; @@ -2300,6 +2305,6 @@ function __loadBrowserData(opts: { const detBtn = document.getElementById("md-lite-detailed"); if (litBtn) litBtn.classList.toggle("active", currentMode === "lite"); if (detBtn) detBtn.classList.toggle("active", currentMode === "detailed"); - switchTab("measures"); + switchTab("sources"); addCopyButtons(); };