feat: miller column browser, offline cache, search, breadcrumbs
- Dynamic miller column sizing with flexbox layout - Root column (160px), middle slices (48px), active column (flex) - Auto-scroll browser to rightmost column on navigation - Offline indicator UI and IndexedDB cache integration - /api/documents endpoint for client-side document caching - Breadcrumb navigation in document content area - FTS5 search with SQLite virtual table - Client-side Mermaid and KaTeX rendering via CDN - Deep sample content (advanced-topics/raft-deep-dive) - Border removal (only search button keeps radius) - Full viewport layout with proper borders between sidebar/content
This commit is contained in:
100
apps/server/internal/httpserver/static/cache.js
Normal file
100
apps/server/internal/httpserver/static/cache.js
Normal file
@@ -0,0 +1,100 @@
|
||||
(function () {
|
||||
const DB_NAME = "md-hub-cache";
|
||||
const DB_VERSION = 1;
|
||||
const STORE_DOCUMENTS = "documents";
|
||||
const STORE_CONTENT = "content";
|
||||
|
||||
function openDB() {
|
||||
return new Promise(function (resolve, reject) {
|
||||
const request = indexedDB.open(DB_NAME, DB_VERSION);
|
||||
request.onerror = function () {
|
||||
reject(request.error);
|
||||
};
|
||||
request.onsuccess = function () {
|
||||
resolve(request.result);
|
||||
};
|
||||
request.onupgradeneeded = function (event) {
|
||||
const db = event.target.result;
|
||||
if (!db.objectStoreNames.contains(STORE_DOCUMENTS)) {
|
||||
db.createObjectStore(STORE_DOCUMENTS, { keyPath: "path" });
|
||||
}
|
||||
if (!db.objectStoreNames.contains(STORE_CONTENT)) {
|
||||
db.createObjectStore(STORE_CONTENT, { keyPath: "path" });
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function cacheDocuments(documents) {
|
||||
return openDB().then(function (db) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
const tx = db.transaction(STORE_DOCUMENTS, "readwrite");
|
||||
const store = tx.objectStore(STORE_DOCUMENTS);
|
||||
documents.forEach(function (doc) {
|
||||
store.put(doc);
|
||||
});
|
||||
tx.oncomplete = function () {
|
||||
resolve();
|
||||
};
|
||||
tx.onerror = function () {
|
||||
reject(tx.error);
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function cacheContent(path, html, title) {
|
||||
return openDB().then(function (db) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
const tx = db.transaction(STORE_CONTENT, "readwrite");
|
||||
const store = tx.objectStore(STORE_CONTENT);
|
||||
store.put({ path: path, html: html, title: title, cachedAt: Date.now() });
|
||||
tx.oncomplete = function () {
|
||||
resolve();
|
||||
};
|
||||
tx.onerror = function () {
|
||||
reject(tx.error);
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getCachedDocuments() {
|
||||
return openDB().then(function (db) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
const tx = db.transaction(STORE_DOCUMENTS, "readonly");
|
||||
const store = tx.objectStore(STORE_DOCUMENTS);
|
||||
const request = store.getAll();
|
||||
request.onsuccess = function () {
|
||||
resolve(request.result);
|
||||
};
|
||||
request.onerror = function () {
|
||||
reject(request.error);
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getCachedContent(path) {
|
||||
return openDB().then(function (db) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
const tx = db.transaction(STORE_CONTENT, "readonly");
|
||||
const store = tx.objectStore(STORE_CONTENT);
|
||||
const request = store.get(path);
|
||||
request.onsuccess = function () {
|
||||
resolve(request.result);
|
||||
};
|
||||
request.onerror = function () {
|
||||
reject(request.error);
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
window.MDHubCache = {
|
||||
cacheDocuments: cacheDocuments,
|
||||
cacheContent: cacheContent,
|
||||
getCachedDocuments: getCachedDocuments,
|
||||
getCachedContent: getCachedContent,
|
||||
};
|
||||
})();
|
||||
@@ -1,35 +1,225 @@
|
||||
(function () {
|
||||
const notice = document.querySelector("[data-version-notice]");
|
||||
const reload = document.querySelector("[data-version-reload]");
|
||||
const offlineNotice = document.querySelector("[data-offline-notice]");
|
||||
const documentShell = document.querySelector("[data-document-path][data-document-hash]");
|
||||
const browser = document.querySelector(".miller-browser");
|
||||
|
||||
if (!notice || !reload || !documentShell || !window.WebSocket) {
|
||||
// Auto-scroll miller browser to show the rightmost (active) column
|
||||
function scrollBrowserToRight() {
|
||||
if (!browser) return;
|
||||
requestAnimationFrame(function () {
|
||||
// Only scroll if the rightmost column is not already visible
|
||||
var tolerance = 50;
|
||||
var maxScroll = browser.scrollWidth - browser.clientWidth;
|
||||
if (maxScroll <= 0) return; // everything fits, no scroll needed
|
||||
if (browser.scrollLeft >= maxScroll - tolerance) return; // already at right edge
|
||||
browser.scrollTo({
|
||||
left: browser.scrollWidth,
|
||||
behavior: "smooth",
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
scrollBrowserToRight();
|
||||
|
||||
function updateOfflineUI() {
|
||||
if (!offlineNotice) return;
|
||||
if (navigator.onLine) {
|
||||
offlineNotice.hidden = true;
|
||||
} else {
|
||||
offlineNotice.hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("online", function () {
|
||||
updateOfflineUI();
|
||||
fetchAndCacheDocuments();
|
||||
});
|
||||
|
||||
window.addEventListener("offline", function () {
|
||||
updateOfflineUI();
|
||||
restoreBrowserFromCache();
|
||||
});
|
||||
|
||||
updateOfflineUI();
|
||||
|
||||
// Cache current page content
|
||||
if (documentShell && window.MDHubCache) {
|
||||
const path = documentShell.getAttribute("data-document-path");
|
||||
const title = document.title;
|
||||
const html = documentShell.querySelector(".markdown-body")?.innerHTML;
|
||||
if (path && html) {
|
||||
window.MDHubCache.cacheContent(path, html, title).catch(function () {});
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch and cache documents
|
||||
function fetchAndCacheDocuments() {
|
||||
if (!window.MDHubCache) return;
|
||||
fetch("/api/documents")
|
||||
.then(function (res) {
|
||||
if (!res.ok) throw new Error("fetch failed");
|
||||
return res.json();
|
||||
})
|
||||
.then(function (data) {
|
||||
if (data.documents) {
|
||||
window.MDHubCache.cacheDocuments(data.documents).catch(function () {});
|
||||
}
|
||||
})
|
||||
.catch(function () {});
|
||||
}
|
||||
|
||||
fetchAndCacheDocuments();
|
||||
|
||||
// Restore browser from cache when offline
|
||||
function restoreBrowserFromCache() {
|
||||
if (!browser || !window.MDHubCache) return;
|
||||
window.MDHubCache.getCachedDocuments().then(function (docs) {
|
||||
if (!docs || docs.length === 0) return;
|
||||
// The browser is already rendered server-side; we just keep it.
|
||||
// If we wanted to rebuild it from cache, we'd need the full logic.
|
||||
// For now, the existing browser HTML is likely cached by the browser itself.
|
||||
}).catch(function () {});
|
||||
}
|
||||
|
||||
// Intercept browser navigation when offline
|
||||
if (browser) {
|
||||
browser.addEventListener("click", function (event) {
|
||||
const link = event.target.closest("a");
|
||||
if (!link) return;
|
||||
if (navigator.onLine) return;
|
||||
|
||||
const href = link.getAttribute("href");
|
||||
if (!href || href.startsWith("http") || href.startsWith("//")) return;
|
||||
|
||||
// Try to serve from cache for document pages
|
||||
if (href.startsWith("/docs/")) {
|
||||
event.preventDefault();
|
||||
const path = href.replace("/docs/", "");
|
||||
window.MDHubCache.getCachedContent(path).then(function (cached) {
|
||||
if (cached && cached.html) {
|
||||
loadCachedDocument(path, cached.title, cached.html);
|
||||
} else {
|
||||
window.location.href = href;
|
||||
}
|
||||
}).catch(function () {
|
||||
window.location.href = href;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadCachedDocument(path, title, html) {
|
||||
if (!documentShell) {
|
||||
window.location.href = "/docs/" + path;
|
||||
return;
|
||||
}
|
||||
|
||||
// Update URL without reloading
|
||||
history.pushState({ cachedPath: path }, title, "/docs/" + path);
|
||||
document.title = title;
|
||||
|
||||
// Update document shell
|
||||
documentShell.setAttribute("data-document-path", path);
|
||||
documentShell.setAttribute("data-document-hash", "");
|
||||
const titleEl = documentShell.querySelector(".document-meta h1");
|
||||
if (titleEl) titleEl.textContent = title;
|
||||
const pathEl = documentShell.querySelector(".meta-grid code");
|
||||
if (pathEl) pathEl.textContent = path;
|
||||
const bodyEl = documentShell.querySelector(".markdown-body");
|
||||
if (bodyEl) bodyEl.innerHTML = html;
|
||||
|
||||
// Re-render math and mermaid
|
||||
if (typeof renderMath === "function") renderMath();
|
||||
if (typeof renderMermaid === "function") renderMermaid();
|
||||
|
||||
// Update active state in browser
|
||||
updateBrowserActiveState(path);
|
||||
}
|
||||
|
||||
function updateBrowserActiveState(activePath) {
|
||||
if (!browser) return;
|
||||
browser.querySelectorAll("a.is-active").forEach(function (el) {
|
||||
el.classList.remove("is-active");
|
||||
});
|
||||
browser.querySelectorAll("a").forEach(function (link) {
|
||||
const href = link.getAttribute("href");
|
||||
if (href === "/docs/" + activePath || href === "/?folder=" + activePath) {
|
||||
link.classList.add("is-active");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// WebSocket realtime updates
|
||||
if (!window.WebSocket) {
|
||||
return;
|
||||
}
|
||||
|
||||
const currentPath = documentShell.getAttribute("data-document-path");
|
||||
const currentHash = documentShell.getAttribute("data-document-hash");
|
||||
const currentPath = documentShell ? documentShell.getAttribute("data-document-path") : null;
|
||||
const currentHash = documentShell ? documentShell.getAttribute("data-document-hash") : null;
|
||||
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
|
||||
const socket = new WebSocket(protocol + "//" + window.location.host + "/ws");
|
||||
let reconnectTimer = null;
|
||||
|
||||
socket.addEventListener("message", function (event) {
|
||||
let payload;
|
||||
try {
|
||||
payload = JSON.parse(event.data);
|
||||
} catch {
|
||||
return;
|
||||
function connect() {
|
||||
const socket = new WebSocket(protocol + "//" + window.location.host + "/ws");
|
||||
|
||||
socket.addEventListener("open", function () {
|
||||
if (reconnectTimer) {
|
||||
clearTimeout(reconnectTimer);
|
||||
reconnectTimer = null;
|
||||
}
|
||||
});
|
||||
|
||||
socket.addEventListener("message", function (event) {
|
||||
let payload;
|
||||
try {
|
||||
payload = JSON.parse(event.data);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
if (payload.type !== "document_version" || !payload.data) {
|
||||
return;
|
||||
}
|
||||
|
||||
const change = payload.data;
|
||||
|
||||
if (currentPath && change.path === currentPath && change.hash !== currentHash) {
|
||||
if (notice) notice.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (browser && !documentShell) {
|
||||
if (notice) notice.hidden = false;
|
||||
}
|
||||
});
|
||||
|
||||
socket.addEventListener("close", function () {
|
||||
reconnectTimer = setTimeout(connect, 3000);
|
||||
});
|
||||
|
||||
socket.addEventListener("error", function () {
|
||||
socket.close();
|
||||
});
|
||||
}
|
||||
|
||||
connect();
|
||||
|
||||
if (reload) {
|
||||
reload.addEventListener("click", function () {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
// Handle back/forward buttons for cached documents
|
||||
window.addEventListener("popstate", function (event) {
|
||||
if (event.state && event.state.cachedPath && window.MDHubCache) {
|
||||
window.MDHubCache.getCachedContent(event.state.cachedPath).then(function (cached) {
|
||||
if (cached && cached.html) {
|
||||
loadCachedDocument(event.state.cachedPath, cached.title, cached.html);
|
||||
}
|
||||
}).catch(function () {});
|
||||
}
|
||||
|
||||
if (payload.type !== "document_version" || !payload.data) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (payload.data.path === currentPath && payload.data.hash !== currentHash) {
|
||||
notice.hidden = false;
|
||||
}
|
||||
});
|
||||
|
||||
reload.addEventListener("click", function () {
|
||||
window.location.reload();
|
||||
});
|
||||
})();
|
||||
|
||||
81
apps/server/internal/httpserver/static/render.js
Normal file
81
apps/server/internal/httpserver/static/render.js
Normal file
@@ -0,0 +1,81 @@
|
||||
(function () {
|
||||
function renderMermaid() {
|
||||
if (typeof mermaid === "undefined") return;
|
||||
const blocks = document.querySelectorAll("pre code.language-mermaid");
|
||||
blocks.forEach(function (block) {
|
||||
const pre = block.parentElement;
|
||||
const container = document.createElement("div");
|
||||
container.className = "mermaid";
|
||||
container.textContent = block.textContent;
|
||||
pre.replaceWith(container);
|
||||
});
|
||||
mermaid.initialize({ startOnLoad: false });
|
||||
mermaid.run({ querySelector: ".mermaid" });
|
||||
}
|
||||
|
||||
function renderMath() {
|
||||
if (typeof katex === "undefined") return;
|
||||
|
||||
const blocks = document.querySelectorAll("pre code.language-math");
|
||||
blocks.forEach(function (block) {
|
||||
const pre = block.parentElement;
|
||||
const container = document.createElement("div");
|
||||
container.className = "katex-block";
|
||||
try {
|
||||
katex.render(block.textContent.trim(), container, {
|
||||
displayMode: true,
|
||||
throwOnError: false,
|
||||
});
|
||||
pre.replaceWith(container);
|
||||
} catch (e) {
|
||||
console.warn("KaTeX render failed:", e);
|
||||
}
|
||||
});
|
||||
|
||||
const markdownBody = document.querySelector(".markdown-body");
|
||||
if (!markdownBody) return;
|
||||
|
||||
const html = markdownBody.innerHTML;
|
||||
let newHtml = html;
|
||||
|
||||
newHtml = newHtml.replace(/\$\$([\s\S]+?)\$\$/g, function (match, tex) {
|
||||
try {
|
||||
return katex.renderToString(tex.trim(), {
|
||||
displayMode: true,
|
||||
throwOnError: false,
|
||||
});
|
||||
} catch (e) {
|
||||
return match;
|
||||
}
|
||||
});
|
||||
|
||||
newHtml = newHtml.replace(/\$([^\s$][^$]*?)\$/g, function (match, tex) {
|
||||
try {
|
||||
return katex.renderToString(tex.trim(), {
|
||||
displayMode: false,
|
||||
throwOnError: false,
|
||||
});
|
||||
} catch (e) {
|
||||
return match;
|
||||
}
|
||||
});
|
||||
|
||||
if (newHtml !== html) {
|
||||
markdownBody.innerHTML = newHtml;
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
renderMermaid();
|
||||
renderMath();
|
||||
}
|
||||
|
||||
window.renderMermaid = renderMermaid;
|
||||
window.renderMath = renderMath;
|
||||
|
||||
if (document.readyState === "loading") {
|
||||
document.addEventListener("DOMContentLoaded", init);
|
||||
} else {
|
||||
init();
|
||||
}
|
||||
})();
|
||||
@@ -24,9 +24,9 @@ body {
|
||||
min-height: 100vh;
|
||||
color: var(--text);
|
||||
background:
|
||||
radial-gradient(circle at top left, rgba(15, 91, 216, 0.16), transparent 34%),
|
||||
radial-gradient(circle at bottom right, rgba(14, 163, 125, 0.13), transparent 28%),
|
||||
linear-gradient(180deg, #fdfaf5 0%, #f5efe6 100%);
|
||||
radial-gradient(circle at top left, rgba(56, 189, 248, 0.28), transparent 34%),
|
||||
radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.22), transparent 30%),
|
||||
linear-gradient(180deg, #eef6ff 0%, #dbeafe 100%);
|
||||
}
|
||||
|
||||
a {
|
||||
@@ -42,21 +42,21 @@ code {
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.42);
|
||||
background: rgba(251, 247, 239, 0.92);
|
||||
background: rgba(238, 246, 255, 0.92);
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
.site-header__inner,
|
||||
.site-main {
|
||||
width: min(1080px, calc(100vw - 2rem));
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.site-header__inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-height: 72px;
|
||||
min-height: 64px;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.site-brand {
|
||||
@@ -68,103 +68,195 @@ code {
|
||||
|
||||
.site-nav {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
gap: 1.25rem;
|
||||
}
|
||||
|
||||
.site-nav a {
|
||||
text-decoration: none;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.site-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
flex: 1;
|
||||
max-width: 320px;
|
||||
margin: 0 1rem;
|
||||
}
|
||||
|
||||
.site-search input {
|
||||
width: 100%;
|
||||
padding: 0.45rem 0.75rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0;
|
||||
background: var(--panel-strong);
|
||||
font: inherit;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.site-search input:focus {
|
||||
outline: 2px solid var(--accent-soft);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.site-search button {
|
||||
padding: 0.45rem 0.6rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--panel-strong);
|
||||
cursor: pointer;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.site-main {
|
||||
padding: 2rem 0 4rem;
|
||||
}
|
||||
|
||||
.document-shell,
|
||||
.error-panel,
|
||||
.empty-preview {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--panel);
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.error-panel,
|
||||
.empty-preview {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.document-shell {
|
||||
padding: 1.5rem 2rem;
|
||||
padding: 0;
|
||||
height: calc(100vh - 64px);
|
||||
}
|
||||
|
||||
/* Workspace layout - adaptive grid */
|
||||
.workspace-shell {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(20rem, 0.42fr) minmax(0, 1fr);
|
||||
gap: 1rem;
|
||||
align-items: start;
|
||||
grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
|
||||
gap: 0;
|
||||
align-items: stretch;
|
||||
height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Document view: sidebar gets reasonable fixed proportion */
|
||||
.workspace-shell--document {
|
||||
grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
|
||||
}
|
||||
|
||||
/* Empty state: more balanced 50/50 feel */
|
||||
.workspace-shell--empty {
|
||||
grid-template-columns: minmax(22rem, 1fr) minmax(18rem, 0.45fr);
|
||||
grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
|
||||
}
|
||||
|
||||
/* Miller browser - flex layout so all columns are visible as vertical slices */
|
||||
.miller-browser {
|
||||
display: grid;
|
||||
grid-auto-columns: minmax(12rem, 1fr);
|
||||
grid-auto-flow: column;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
overflow-x: auto;
|
||||
min-height: 22rem;
|
||||
min-height: 100%;
|
||||
max-height: 100%;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-lg);
|
||||
border-right: 0;
|
||||
border-radius: 0;
|
||||
background: var(--panel);
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.miller-column {
|
||||
min-width: 12rem;
|
||||
.miller-browser + .document-shell {
|
||||
border-left: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.miller-column {
|
||||
flex: 0 0 auto;
|
||||
border-left: 1px solid var(--border);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Root column - fixed width for top-level navigation */
|
||||
.miller-column:first-child {
|
||||
width: 160px;
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
/* Middle columns - narrow slices (48px shows ~32px of content) */
|
||||
.miller-column:not(:first-child):not(:last-child) {
|
||||
width: 48px;
|
||||
}
|
||||
|
||||
/* Active/last column - grows to fill remaining sidebar space */
|
||||
.miller-column:last-child {
|
||||
flex: 1 1 auto;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.miller-column h2 {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
margin: 0;
|
||||
padding: 0.75rem 0.85rem;
|
||||
padding: 0.7rem 0.8rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: rgba(255, 255, 255, 0.72);
|
||||
color: var(--muted);
|
||||
font: 700 0.76rem/1.2 ui-monospace, SFMono-Regular, monospace;
|
||||
font: 700 0.72rem/1.2 ui-monospace, SFMono-Regular, monospace;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* Middle column headers - show just first couple chars */
|
||||
.miller-column:not(:first-child):not(:last-child) h2 {
|
||||
padding: 0.7rem 0.3rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.miller-column:not(:first-child):not(:last-child) h2 .miller-column-title-text {
|
||||
display: inline-block;
|
||||
max-width: 2rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.miller-column ul {
|
||||
margin: 0;
|
||||
padding: 0.35rem;
|
||||
padding: 0.3rem;
|
||||
list-style: none;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.miller-column a {
|
||||
display: flex;
|
||||
min-height: 2.25rem;
|
||||
min-height: 2.1rem;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
padding: 0.45rem 0.55rem;
|
||||
border-radius: var(--radius-sm);
|
||||
gap: 0.5rem;
|
||||
padding: 0.4rem 0.5rem;
|
||||
border-radius: 0;
|
||||
color: var(--text);
|
||||
text-decoration: none;
|
||||
font-size: 0.94rem;
|
||||
}
|
||||
|
||||
/* Middle column items - icon + truncated text */
|
||||
.miller-column:not(:first-child):not(:last-child) a {
|
||||
padding: 0.4rem 0.2rem;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.miller-column:not(:first-child):not(:last-child) .browser-item-label {
|
||||
justify-content: center;
|
||||
gap: 0.15rem;
|
||||
}
|
||||
|
||||
.miller-column:not(:first-child):not(:last-child) .browser-item-name {
|
||||
display: inline-block;
|
||||
max-width: 1.6rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.miller-column:not(:first-child):not(:last-child) .browser-item-chevron {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.browser-item-label {
|
||||
display: inline-flex;
|
||||
min-width: 0;
|
||||
align-items: center;
|
||||
gap: 0.45rem;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.browser-icon {
|
||||
@@ -178,7 +270,7 @@ code {
|
||||
.browser-icon--folder {
|
||||
margin-top: 0.1rem;
|
||||
border: 1px solid rgba(15, 91, 216, 0.24);
|
||||
border-radius: 0.18rem;
|
||||
border-radius: 0;
|
||||
background: var(--accent-soft);
|
||||
}
|
||||
|
||||
@@ -190,18 +282,18 @@ code {
|
||||
height: 0.25rem;
|
||||
border: 1px solid rgba(15, 91, 216, 0.24);
|
||||
border-bottom: 0;
|
||||
border-radius: 0.14rem 0.14rem 0 0;
|
||||
border-radius: 0;
|
||||
background: var(--accent-soft);
|
||||
content: "";
|
||||
}
|
||||
|
||||
.browser-icon--file {
|
||||
.browser-icon--page {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.16rem;
|
||||
border-radius: 0;
|
||||
background: rgba(255, 255, 255, 0.72);
|
||||
}
|
||||
|
||||
.browser-icon--file::before {
|
||||
.browser-icon--page::before {
|
||||
position: absolute;
|
||||
right: -1px;
|
||||
top: -1px;
|
||||
@@ -213,18 +305,66 @@ code {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.browser-icon--root {
|
||||
width: 0.85rem;
|
||||
height: 0.85rem;
|
||||
border: 1.5px solid var(--accent);
|
||||
border-radius: 0;
|
||||
background: var(--accent-soft);
|
||||
}
|
||||
|
||||
.browser-icon--root::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 0.3rem;
|
||||
height: 0.3rem;
|
||||
border-radius: 0;
|
||||
background: var(--accent);
|
||||
transform: translate(-50%, -50%);
|
||||
content: "";
|
||||
}
|
||||
|
||||
.miller-column--root h2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
.miller-column a:hover,
|
||||
.miller-column a.is-active {
|
||||
background: var(--accent-soft);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.browser-item-label span:last-child {
|
||||
.browser-item-name {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Document shell */
|
||||
.document-shell,
|
||||
.error-panel,
|
||||
.empty-preview {
|
||||
border: 1px solid var(--border);
|
||||
border-left: 0;
|
||||
border-radius: 0;
|
||||
background: var(--panel);
|
||||
}
|
||||
|
||||
.error-panel,
|
||||
.empty-preview {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.document-shell {
|
||||
padding: 1.5rem 2rem;
|
||||
min-height: 100%;
|
||||
max-height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
margin: 0 0 0.8rem;
|
||||
color: var(--accent);
|
||||
@@ -254,11 +394,52 @@ code {
|
||||
.tag-list a {
|
||||
display: inline-flex;
|
||||
padding: 0.15rem 0.4rem;
|
||||
border-radius: 999px;
|
||||
border-radius: 0;
|
||||
background: var(--accent-soft);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.breadcrumbs {
|
||||
margin-bottom: 0.75rem;
|
||||
padding-bottom: 0.75rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.breadcrumbs ol {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.25rem;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.breadcrumbs li {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.breadcrumbs li:not(:last-child)::after {
|
||||
content: "/";
|
||||
color: var(--muted);
|
||||
margin-left: 0.25rem;
|
||||
}
|
||||
|
||||
.breadcrumbs a {
|
||||
color: var(--accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.breadcrumbs a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.breadcrumbs span[aria-current="page"] {
|
||||
color: var(--text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.document-meta {
|
||||
margin-bottom: 1.5rem;
|
||||
padding-bottom: 1rem;
|
||||
@@ -273,7 +454,7 @@ code {
|
||||
|
||||
.meta-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
||||
gap: 0.75rem;
|
||||
margin: 0;
|
||||
}
|
||||
@@ -303,7 +484,7 @@ code {
|
||||
.markdown-body pre {
|
||||
overflow-x: auto;
|
||||
padding: 1rem;
|
||||
border-radius: var(--radius-md);
|
||||
border-radius: 0;
|
||||
background: #18202a;
|
||||
color: #f7f9fc;
|
||||
}
|
||||
@@ -312,7 +493,7 @@ code {
|
||||
margin-left: 0;
|
||||
padding: 0.9rem 1rem;
|
||||
border-left: 4px solid var(--accent);
|
||||
border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
|
||||
border-radius: 0;
|
||||
background: rgba(15, 91, 216, 0.05);
|
||||
}
|
||||
|
||||
@@ -330,9 +511,37 @@ code {
|
||||
max-width: min(28rem, calc(100vw - 2rem));
|
||||
padding: 0.75rem 0.85rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
border-radius: 0;
|
||||
background: var(--panel-strong);
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.offline-notice {
|
||||
position: fixed;
|
||||
left: 1rem;
|
||||
bottom: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
max-width: min(28rem, calc(100vw - 2rem));
|
||||
padding: 0.6rem 0.85rem;
|
||||
border: 1px solid rgba(234, 179, 8, 0.4);
|
||||
border-radius: 0;
|
||||
background: rgba(254, 252, 232, 0.95);
|
||||
color: #854d0e;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.offline-notice[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.offline-icon {
|
||||
display: inline-block;
|
||||
width: 0.6rem;
|
||||
height: 0.6rem;
|
||||
border-radius: 0;
|
||||
background: #eab308;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.version-notice[hidden] {
|
||||
@@ -348,36 +557,155 @@ code {
|
||||
min-height: 2.2rem;
|
||||
padding: 0 0.8rem;
|
||||
border: 0;
|
||||
border-radius: var(--radius-sm);
|
||||
border-radius: 0;
|
||||
color: white;
|
||||
background: var(--accent);
|
||||
font: 700 0.9rem/1 ui-monospace, SFMono-Regular, monospace;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
/* Adaptive breakpoints */
|
||||
@media (max-width: 1024px) {
|
||||
.workspace-shell,
|
||||
.workspace-shell--document,
|
||||
.workspace-shell--empty {
|
||||
grid-template-columns: minmax(240px, 0.45fr) minmax(0, 1fr);
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.document-shell {
|
||||
padding: 1.25rem 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.site-header__inner {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.75rem 0;
|
||||
padding: 0.75rem 1rem;
|
||||
min-height: auto;
|
||||
}
|
||||
|
||||
.site-main {
|
||||
height: auto;
|
||||
min-height: calc(100vh - 64px);
|
||||
}
|
||||
|
||||
.workspace-shell,
|
||||
.workspace-shell--document,
|
||||
.workspace-shell--empty {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.miller-browser {
|
||||
min-height: 14rem;
|
||||
min-height: 16rem;
|
||||
max-height: 50vh;
|
||||
border-right: 1px solid var(--border);
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.miller-column,
|
||||
.miller-column:first-child,
|
||||
.miller-column:last-child,
|
||||
.miller-column:not(:first-child):not(:last-child) {
|
||||
flex: 0 0 auto;
|
||||
width: auto;
|
||||
min-width: 9rem;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.miller-column:not(:first-child):not(:last-child) h2 {
|
||||
padding: 0.7rem 0.8rem;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.miller-column:not(:first-child):not(:last-child) h2 .miller-column-title-text {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.miller-column:not(:first-child):not(:last-child) a {
|
||||
padding: 0.4rem 0.5rem;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.miller-column:not(:first-child):not(:last-child) .browser-item-label {
|
||||
justify-content: flex-start;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.miller-column:not(:first-child):not(:last-child) .browser-item-name {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.miller-column:not(:first-child):not(:last-child) .browser-item-chevron {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.document-shell {
|
||||
padding: 1.25rem;
|
||||
min-height: auto;
|
||||
max-height: none;
|
||||
border-left: 1px solid var(--border);
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.meta-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1600px) {
|
||||
.workspace-shell--document {
|
||||
grid-template-columns: minmax(300px, 0.32fr) minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
/* Search results */
|
||||
.search-panel {
|
||||
max-width: 800px;
|
||||
padding: 2rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0;
|
||||
background: var(--panel);
|
||||
}
|
||||
|
||||
.search-results {
|
||||
margin: 1.5rem 0 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.search-results li {
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.search-results li:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.search-results a {
|
||||
display: block;
|
||||
padding: 1rem 0;
|
||||
color: var(--text);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.search-results a:hover {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.search-result-title {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.search-result-path {
|
||||
display: block;
|
||||
color: var(--muted);
|
||||
font-size: 0.85rem;
|
||||
font-family: ui-monospace, SFMono-Regular, monospace;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user