Revert "Strengthen search breadth and modal fitting"

This reverts commit 5ca7aef3f1.
This commit is contained in:
AI Assistant
2026-03-17 13:20:44 +09:00
parent 5ca7aef3f1
commit 3f824c4bdf
10 changed files with 49 additions and 110 deletions
+4 -29
View File
@@ -38,7 +38,6 @@ const downloadLogs = document.getElementById("downloadLogs");
const debugLogList = document.getElementById("debugLogList");
const debugSummary = document.getElementById("debugSummary");
const resultModal = document.getElementById("resultModal");
const resultModalShell = document.getElementById("resultModalShell");
const resultModalTitle = document.getElementById("resultModalTitle");
const resultModalSource = document.getElementById("resultModalSource");
const resultModalSnippet = document.getElementById("resultModalSnippet");
@@ -57,7 +56,6 @@ const resultModalSecondaryAction = document.getElementById("resultModalSecondary
const closeResultModal = document.getElementById("closeResultModal");
const resultModalReady = Boolean(
resultModal &&
resultModalShell &&
resultModalTitle &&
resultModalSource &&
resultModalSnippet &&
@@ -438,30 +436,12 @@ function resetPreviewPlayer() {
function showModal(element) {
setHidden(element, false);
if (element === resultModal) {
syncResultModalLayout();
}
}
function hideModal(element) {
setHidden(element, true);
}
function syncResultModalLayout() {
if (!resultModalReady) {
return;
}
const viewportWidth = Math.max(320, window.innerWidth || document.documentElement.clientWidth || 0);
const viewportHeight = Math.max(320, window.innerHeight || document.documentElement.clientHeight || 0);
const shellWidth = Math.min(1150, viewportWidth - 16);
const shellHeight = Math.min(840, viewportHeight - 12);
const mediaHeight = Math.max(150, Math.min(Math.floor(viewportHeight * 0.32), 320));
resultModalShell.style.setProperty("--result-modal-shell-width", `${shellWidth}px`);
resultModalShell.style.setProperty("--result-modal-shell-height", `${shellHeight}px`);
resultModalShell.style.setProperty("--result-modal-media-max-height", `${mediaHeight}px`);
resultModalShell.classList.toggle("result-modal-compact", viewportHeight < 900 || viewportWidth < 1280);
}
function buildResultModalEmbedURL(item) {
if (item?.embedUrl) {
if (item.source === "Google Video" && item.embedUrl.includes("youtube-nocookie.com/embed/")) {
@@ -609,7 +589,7 @@ async function fetchResultPreview(item) {
}
const request = (async () => {
try {
const preview = await api("/api/download/preview", {
const preview = await api("/api/download/preview", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url: key }),
@@ -691,10 +671,10 @@ function renderResults(results) {
node.addEventListener("click", () => openResultModal(item));
previewVideo.poster = usableThumbnail ? item.thumbnailUrl : "";
const mediaArea = node.querySelector(".relative");
if (item.previewVideoUrl || item.source === "Google Video" || item.source === "Artgrid") {
if (item.previewVideoUrl || item.source === "Google Video") {
mediaArea.addEventListener("mouseenter", async () => {
let previewURL = item.previewVideoUrl || "";
if (!previewURL && (item.source === "Google Video" || item.source === "Artgrid")) {
if (!previewURL && item.source === "Google Video") {
const preview = await fetchResultPreview(item);
previewURL = preview?.previewStreamUrl || "";
}
@@ -769,7 +749,7 @@ async function openResultModal(item) {
const embedURL = buildResultModalEmbedURL(item);
const fallbackReason = item.previewBlockedReason || "Embedded view was unavailable, switched to fallback preview.";
let resolvedPreviewURL = item.previewVideoUrl || "";
if (!resolvedPreviewURL && (item.source === "Google Video" || item.source === "Artgrid")) {
if (!resolvedPreviewURL && item.source === "Google Video") {
const preview = await fetchResultPreview(item);
resolvedPreviewURL = preview?.previewStreamUrl || "";
}
@@ -1050,11 +1030,6 @@ if (resultModalReady) {
}
});
}
window.addEventListener("resize", () => {
if (resultModalReady && !resultModal.classList.contains("hidden")) {
syncResultModalLayout();
}
});
for (const button of platformToggles) {
button.addEventListener("click", () => {
const platform = button.dataset.platformToggle;
+4 -4
View File
@@ -150,7 +150,7 @@
</div>
<div id="resultModal" class="fixed inset-0 z-50 hidden items-start justify-center overflow-y-auto bg-black/80 px-2 py-2 sm:px-4 sm:py-4">
<div id="resultModalShell" class="result-modal-shell flex w-full max-w-6xl min-h-0 flex-col overflow-hidden rounded-3xl border border-white/10 bg-zinc-950 shadow-2xl">
<div class="result-modal-shell flex w-full max-w-6xl min-h-0 flex-col overflow-hidden rounded-3xl border border-white/10 bg-zinc-950 shadow-2xl">
<div class="flex items-center justify-between border-b border-white/10 px-4 py-3 sm:px-5 sm:py-4">
<div class="min-w-0">
<p id="resultModalSource" class="text-xs uppercase tracking-[0.25em] text-zinc-500"></p>
@@ -180,13 +180,13 @@
</div>
</div>
<div class="result-modal-details grid min-h-0 gap-3 px-3 py-3 sm:gap-4 sm:px-4 sm:py-4 lg:grid-cols-[1.5fr_0.8fr]">
<div class="flex min-h-0 min-w-0 flex-col rounded-2xl border border-white/10 bg-white/[0.03] p-4">
<div class="flex min-h-[180px] min-w-0 flex-col rounded-2xl border border-white/10 bg-white/[0.03] p-4">
<p class="text-xs uppercase tracking-[0.25em] text-zinc-500">AI Note</p>
<div class="result-panel-scroll mt-3 min-h-0 flex-1 overflow-y-auto pr-2">
<p id="resultModalReason" class="whitespace-pre-wrap text-xs leading-6 text-zinc-200 sm:text-sm"></p>
</div>
</div>
<div class="flex min-h-0 min-w-0 flex-col rounded-2xl border border-white/10 bg-white/[0.03] p-4">
<div class="flex min-h-[200px] min-w-0 flex-col rounded-2xl border border-white/10 bg-white/[0.03] p-4">
<div class="mb-3 flex flex-col gap-2">
<button id="resultModalDownload" type="button" class="hidden w-full rounded-2xl border border-white bg-white px-4 py-3 text-sm font-medium text-black transition hover:bg-zinc-200">
Primary Action
@@ -224,6 +224,6 @@
</button>
</template>
<script src="/app.js?v=20260317d" defer></script>
<script src="/app.js?v=20260317c" defer></script>
</body>
</html>
+2 -13
View File
@@ -60,8 +60,7 @@ body {
}
.result-modal-shell {
height: var(--result-modal-shell-height, min(calc(100dvh - 0.5rem), 860px));
max-width: var(--result-modal-shell-width, 72rem);
height: min(calc(100dvh - 0.5rem), 860px);
margin: auto;
}
@@ -70,7 +69,7 @@ body {
}
.result-modal-media-frame {
max-height: var(--result-modal-media-max-height, min(34dvh, 22rem));
max-height: min(34dvh, 22rem);
}
.result-modal-details {
@@ -80,16 +79,6 @@ body {
align-items: stretch;
}
.result-modal-shell.result-modal-compact .result-modal-details {
gap: 0.5rem;
}
.result-modal-shell.result-modal-compact #resultModalReason,
.result-modal-shell.result-modal-compact #resultModalSnippet {
font-size: 0.75rem;
line-height: 1.35rem;
}
#resultModalSnippet,
#resultModalReason {
white-space: pre-wrap;