specra 0.2.55 → 0.2.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -88,16 +88,30 @@
88
88
  );
89
89
 
90
90
  let filteredDocs = $derived.by(() => {
91
- if (hasTabGroups && activeTabGroup) {
92
- return docs.filter((doc) => {
93
- const docTabGroup = doc.meta?.tab_group || doc.categoryTabGroup;
94
- if (!docTabGroup) {
95
- return activeTabGroup === config.navigation?.tabGroups?.[0]?.id;
96
- }
97
- return docTabGroup === activeTabGroup;
98
- });
99
- }
100
- return docs;
91
+ if (!hasTabGroups) return docs;
92
+
93
+ // Fall back to the first tab group when activeTabGroup isn't set —
94
+ // that happens whenever the current doc has no `tab_group` in its
95
+ // frontmatter and no `_category_.json` ancestor with a tab_group.
96
+ // Without this fallback the sidebar bypasses tab filtering entirely
97
+ // and renders every doc, while the tab bar still visually highlights
98
+ // the first tab (TabGroups.svelte applies the same fallback on its
99
+ // own `activeTab`). The end result looked like "every tab contains
100
+ // every doc" — but the real cause was that the sidebar's filter just
101
+ // wasn't running.
102
+ const effectiveTabGroup =
103
+ activeTabGroup || config.navigation?.tabGroups?.[0]?.id;
104
+ if (!effectiveTabGroup) return docs;
105
+
106
+ const firstTabId = config.navigation?.tabGroups?.[0]?.id;
107
+ return docs.filter((doc) => {
108
+ const docTabGroup = doc.meta?.tab_group || doc.categoryTabGroup;
109
+ if (!docTabGroup) {
110
+ // Unlabeled docs land in the first tab group (Getting Started).
111
+ return effectiveTabGroup === firstTabId;
112
+ }
113
+ return docTabGroup === effectiveTabGroup;
114
+ });
101
115
  });
102
116
 
103
117
  // Build hierarchical tree structure
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specra",
3
- "version": "0.2.55",
3
+ "version": "0.2.56",
4
4
  "description": "A modern documentation library for SvelteKit with built-in versioning, API reference generation, full-text search, and MDX support",
5
5
  "svelte": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",