Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion site/src/lib/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const formatTimeForTitle = (milliseconds: number): string => {
// Get display name for Tab (tab title) using $match
export const getDisplayName = (tab: Tab): string => {
return $match(tab.app, {
Bible: ({ bibleState }) => `${getBibleBookDisplayName(bibleState.currentBook)} ${bibleState.currentChapter}`,
Bible: ({ bibleState }) => `${getBibleBookDisplayName(bibleState.currentBook)} ${bibleState.currentChapter} (${bibleState.translation.metadata.shortName})`,
About: () => "About",
ChooseApp: () => "Choose App",
Stopwatch: ({ stopwatchState }) => {
Expand Down
18 changes: 13 additions & 5 deletions site/src/lib/components/AppContainer.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<script lang="ts">
import type { Translation } from "$lib/translations/translation";
import { BibleBook } from "$lib/book";
import {
type Tab,
getTabId,
import {
type Tab,
getTabId,
getTabUrl,
createBibleTab,
createAboutTab,
getDisplayName,
createBibleTab,
createAboutTab,
createChooseTab,
createStopwatchTab
} from "$lib/app";
Expand Down Expand Up @@ -65,6 +66,13 @@
// Get active tab reference
let activeTab = $derived(tabs.find(tab => getTabId(tab) === activeTabId));

// Update browser title when active tab changes
$effect(() => {
if (activeTab && typeof document !== 'undefined') {
document.title = getDisplayName(activeTab);
}
});

// Update tab state
function updateTabState(updatedTab: Tab) {
const tabId = getTabId(updatedTab);
Expand Down
7 changes: 5 additions & 2 deletions site/src/lib/components/bible/BibleReader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@
internalBook = bookOption.value;
internalChapter = chapter;
onStateChange(bookOption.value, chapter);

// Auto-hide canon explorer on mobile after chapter selection
// Use setTimeout to ensure state update completes before toggling
if (isMobile) {
onToggleCanonExplorer();
setTimeout(() => {
onToggleCanonExplorer();
}, 0);
}
}
}
Expand Down