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:
@@ -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