fix the search function/display

This commit is contained in:
2026-03-12 04:37:26 -07:00
parent d705d7a243
commit 9da3ccf678
3 changed files with 47 additions and 3 deletions

View File

@@ -3462,6 +3462,19 @@
min-width: 0;
}
.planet-layout.alpha-text-global-search-only {
grid-template-columns: minmax(0, 1fr);
}
.planet-layout.alpha-text-global-search-only > .planet-list-panel,
.planet-layout.alpha-text-global-search-only > .planet-detail-panel > .alpha-text-detail-heading,
.planet-layout.alpha-text-global-search-only .alpha-text-heading-tools,
.planet-layout.alpha-text-global-search-only .alpha-text-controls--heading,
.planet-layout.alpha-text-global-search-only .alpha-text-search-controls--detail,
.planet-layout.alpha-text-global-search-only .alpha-text-search-inline {
display: none !important;
}
@media (max-width: 1040px) {
.alpha-text-heading-tools {
grid-template-columns: 1fr;
@@ -5377,6 +5390,9 @@
grid-template-columns: minmax(0, 1fr);
grid-template-rows: minmax(220px, 42svh) minmax(0, 1fr);
}
.planet-layout.alpha-text-global-search-only {
grid-template-rows: minmax(0, 1fr);
}
.planet-layout.layout-sidebar-collapsed,
.planet-layout.layout-detail-collapsed,
.tarot-layout.layout-sidebar-collapsed,

View File

@@ -37,8 +37,10 @@
let localSearchInputEl;
let workSelectEl;
let sectionSelectEl;
let detailHeadingEl;
let detailNameEl;
let detailSubEl;
let detailHeadingToolsEl;
let detailBodyEl;
let textLayoutEl;
let lexiconPopupEl;
@@ -63,13 +65,34 @@
localSearchInputEl = document.getElementById("alpha-text-local-search-input");
workSelectEl = document.getElementById("alpha-text-work-select");
sectionSelectEl = document.getElementById("alpha-text-section-select");
detailHeadingEl = document.querySelector("#alphabet-text-section .alpha-text-detail-heading");
detailNameEl = document.getElementById("alpha-text-detail-name");
detailSubEl = document.getElementById("alpha-text-detail-sub");
detailHeadingToolsEl = document.querySelector("#alphabet-text-section .alpha-text-heading-tools");
detailBodyEl = document.getElementById("alpha-text-detail-body");
textLayoutEl = sourceListEl?.closest?.(".planet-layout") || detailBodyEl?.closest?.(".planet-layout") || null;
ensureLexiconPopup();
}
function setGlobalSearchHeadingMode(isGlobalSearchOnly) {
if (textLayoutEl instanceof HTMLElement) {
textLayoutEl.classList.toggle("alpha-text-global-search-only", Boolean(isGlobalSearchOnly));
textLayoutEl.setAttribute("data-global-search-only", isGlobalSearchOnly ? "true" : "false");
}
if (detailHeadingEl instanceof HTMLElement) {
detailHeadingEl.hidden = Boolean(isGlobalSearchOnly);
detailHeadingEl.setAttribute("aria-hidden", isGlobalSearchOnly ? "true" : "false");
}
if (!(detailHeadingToolsEl instanceof HTMLElement)) {
return;
}
detailHeadingToolsEl.hidden = Boolean(isGlobalSearchOnly);
detailHeadingToolsEl.setAttribute("aria-hidden", isGlobalSearchOnly ? "true" : "false");
}
function showDetailOnlyMode() {
if (!(textLayoutEl instanceof HTMLElement)) {
return;
@@ -1411,7 +1434,7 @@
}
function isGlobalSearchOnlyMode() {
return state.activeSearchScope === "global"
return (state.activeSearchScope === "global" || state.activeSearchScope === "source")
&& Boolean(state.searchQuery)
&& !state.highlightedVerseId;
}
@@ -1421,6 +1444,7 @@
const work = getSelectedWork(source);
const section = getSelectedSection(source, work);
const globalSearchOnlyMode = isGlobalSearchOnlyMode();
setGlobalSearchHeadingMode(globalSearchOnlyMode);
if (!source || !work || !section) {
renderPlaceholder("Text Reader", "Select a source to begin", "Choose a text source and section from the left panel.");
@@ -1524,6 +1548,10 @@
return;
}
if (normalizedScope === "global" || normalizedScope === "source") {
showDetailOnlyMode();
}
const requestId = state.searchRequestId + 1;
state.searchRequestId = requestId;
state.searchLoading = true;

View File

@@ -16,7 +16,7 @@
<link rel="stylesheet" href="node_modules/@fontsource/amiri/arabic-400.css">
<link rel="stylesheet" href="node_modules/@fontsource/amiri/arabic-700.css">
<link rel="stylesheet" href="node_modules/@fontsource/noto-naskh-arabic/arabic-400.css">
<link rel="stylesheet" href="app/styles.css?v=20260312-text-counts-01">
<link rel="stylesheet" href="app/styles.css?v=20260312-global-search-04">
</head>
<body>
<div class="topbar">
@@ -997,7 +997,7 @@
<script src="app/ui-alphabet-detail.js?v=20260309-enochian-api"></script>
<script src="app/ui-alphabet-kabbalah.js"></script>
<script src="app/ui-alphabet.js?v=20260308b"></script>
<script src="app/ui-alphabet-text.js?v=20260312-text-counts-01"></script>
<script src="app/ui-alphabet-text.js?v=20260312-source-search-01"></script>
<script src="app/ui-zodiac-references.js"></script>
<script src="app/ui-zodiac.js"></script>
<script src="app/ui-quiz-bank-builtins-domains.js"></script>