feat: index Codex sessions alongside Claude Code with source tagging

Add `source` column to sessions and messages ('claude' | 'codex').
  Discover and parse Codex JSONL files from ~/.codex/sessions/, mapping
  Codex thread/item structures to the same schema (messages, tool_calls,
  tool_results, subagents). Move DB to ~/.obelisk/ with legacy migration.
  Add rebuild-to-temp-then-swap for safe full rebuilds. On the app side:
  source filter toggle, collapsible untitled session fold, configurable
  codexDir in Settings, and a dev script. Update SKILL.md and query
  helpers to expose source fields and accept source filter opt.
This commit is contained in:
tommy0103
2026-06-17 23:40:36 +08:00
parent e3ca1735b9
commit 12407227cc
22 changed files with 2259 additions and 244 deletions
+11
View File
@@ -425,6 +425,17 @@
.session-eyebrow .project-name { color: var(--fg-2); font-weight: 500; }
.session-eyebrow .project-path { font-family: var(--font-mono); color: var(--muted); }
.session-eyebrow .sep { color: var(--muted-2); margin: 0 2px; }
.session-eyebrow .via {
display: inline-flex; align-items: center; gap: 5px;
font-family: var(--font-mono); font-size: 10.5px; color: var(--muted);
letter-spacing: 0.02em;
padding: 1px 7px; background: rgba(255,255,255,0.04);
border: 1px solid var(--hairline); border-radius: 3px;
margin-left: 6px;
}
.session-eyebrow .via .via-dot { width: 4px; height: 4px; border-radius: 50%; }
.session-eyebrow .via .via-dot.claude { background: #d97757; box-shadow: 0 0 4px rgba(217,119,87,0.5); }
.session-eyebrow .via .via-dot.codex { background: #10a37f; box-shadow: 0 0 4px rgba(16,163,127,0.5); }
.session-title {
font-size: 22px; font-weight: 600; color: var(--fg);
line-height: 1.3; margin-bottom: 14px; letter-spacing: -0.01em;
+106 -3
View File
@@ -2,11 +2,12 @@
border-right: 1px solid var(--hairline-strong);
background: rgba(0,0,0,0.2);
display: flex; flex-direction: column;
min-height: 0;
min-height: 0; min-width: 0; overflow: hidden;
}
.sidebar-brand {
display: flex; align-items: center; gap: 8px;
padding: 0 14px; height: 36px;
position: relative;
border-bottom: 1px solid var(--hairline);
flex-shrink: 0;
}
@@ -17,13 +18,115 @@
.sidebar-section + .sidebar-section { border-top: 1px solid var(--hairline); }
.sidebar-spacer { flex: 1; min-height: 0; }
.sidebar-bottom { margin-top: auto; }
/* Source health dots — each dot = one source, colored by brand + status */
.source-health {
display: inline-flex; align-items: center; gap: 3px;
padding: 4px 6px; border-radius: 4px; margin-left: auto;
cursor: pointer; transition: background 0.1s;
}
.source-health:hover { background: var(--surface-strong); }
.source-health .h-dot {
width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0;
}
.source-health .h-dot.claude-ok { background: #d97757; box-shadow: 0 0 4px rgba(217,119,87,0.6); }
.source-health .h-dot.claude-warn { background: rgba(217,119,87,0.4); }
.source-health .h-dot.claude-error { background: rgba(217,119,87,0.25); }
.source-health .h-dot.codex-ok { background: #10a37f; box-shadow: 0 0 4px rgba(16,163,127,0.6); }
.source-health .h-dot.codex-warn { background: rgba(16,163,127,0.4); }
.source-health .h-dot.codex-error { background: rgba(16,163,127,0.25); }
.source-health .h-dot.off { background: var(--muted-3); }
/* Sources popover */
.sources-popover {
position: absolute; top: 100%; left: 0; margin-top: 6px;
width: 260px; background: rgba(20, 22, 38, 0.98);
backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
border: 1px solid var(--hairline-strong); border-radius: 8px;
box-shadow: 0 12px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
opacity: 0; transform: translateY(-4px);
pointer-events: none; transition: all 0.15s; z-index: 200; overflow: hidden;
}
.sources-popover.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.sp-head {
padding: 10px 14px 8px; border-bottom: 1px solid var(--hairline);
font-size: 11.5px; color: var(--muted);
}
.sp-list { padding: 6px 0; }
.sp-row {
display: flex; align-items: center; gap: 10px;
padding: 8px 14px; cursor: pointer; transition: background 0.08s;
width: 100%; text-align: left; border: none; background: none; color: inherit;
}
.sp-row:hover { background: rgba(255,255,255,0.03); }
.sp-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sp-dot.claude { background: #d97757; box-shadow: 0 0 6px rgba(217,119,87,0.5); }
.sp-dot.codex { background: #10a37f; box-shadow: 0 0 6px rgba(16,163,127,0.5); }
.sp-dot.off { background: var(--muted-3); }
.sp-body { flex: 1; min-width: 0; }
.sp-name { font-size: 12.5px; color: var(--fg); font-weight: 500; display: flex; align-items: baseline; gap: 6px; }
.sp-name .sp-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); font-weight: 400; }
.sp-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.sp-meta.warn { color: #fbbf24; }
.sp-meta.error { color: #f87171; }
.sp-foot {
padding: 8px 14px; border-top: 1px solid var(--hairline); background: rgba(0,0,0,0.2);
}
.sp-foot button {
font-size: 11.5px; color: var(--accent-2); border: none; background: none;
cursor: pointer; border-bottom: 1px solid rgba(167,139,250,0.4); padding-bottom: 1px;
transition: all 0.12s;
}
.sp-foot button:hover { color: var(--accent); border-bottom-color: var(--accent); }
/* Project noise fold */
.project-fold {
display: flex; align-items: center; gap: 8px;
padding: 0 10px; height: 26px; border-radius: 5px;
color: var(--muted); font-size: 12px;
cursor: pointer; user-select: none; transition: all 0.08s;
width: 100%; text-align: left; border: none; background: none;
}
.project-fold:hover { background: var(--surface-strong); color: var(--fg-2); }
.project-fold.expanded { color: var(--fg-3); }
.project-fold .chev {
width: 9px; height: 9px; color: var(--muted-2);
transition: transform 0.15s; flex-shrink: 0;
}
.project-fold.expanded .chev { transform: rotate(90deg); color: var(--muted); }
.project-fold .label { flex: 1; }
.project-fold .count {
font-family: var(--font-mono); font-size: 10px; color: var(--muted-2);
font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.sidebar-item.noise { opacity: 0.6; }
.sidebar-item.noise .icon { color: var(--muted-2); }
.sidebar-item.noise .label {
font-family: var(--font-mono); font-size: 11.5px;
color: var(--muted); letter-spacing: 0.005em;
}
.sidebar-item.noise:hover { opacity: 1; }
.sidebar-section-title {
padding: 4px 10px 6px;
font-size: 10.5px; color: var(--muted);
font-weight: 500; letter-spacing: 0.04em;
display: flex; justify-content: space-between;
flex-shrink: 0;
display: flex; align-items: center; justify-content: space-between;
}
.sidebar-section-title .filter-toggle {
display: inline-flex; align-items: center; gap: 4px;
font-family: var(--font-mono); font-size: 10px; color: var(--muted);
letter-spacing: 0.02em; cursor: pointer;
padding: 2px 6px; border-radius: 3px;
text-transform: lowercase; transition: all 0.1s;
white-space: nowrap; flex-shrink: 0;
background: none; border: 1px solid transparent;
width: auto; max-width: none;
}
.sidebar-section-title .filter-toggle svg { width: 10px; height: 10px; flex-shrink: 0; }
.sidebar-section-title .filter-toggle:hover { color: var(--fg-2); background: var(--surface); border-color: var(--hairline-strong); }
.sidebar-section-title .filter-toggle.active { color: var(--accent-2); background: var(--accent-soft); border-color: rgba(167,139,250,0.35); }
.sidebar-search { position: relative; padding: 0 6px 6px; flex-shrink: 0; }
.sidebar-search input {
width: 100%; height: 24px;
+47
View File
@@ -7,6 +7,7 @@
background: rgba(0,0,0,0.15);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
position: relative; z-index: 50;
}
.breadcrumb { display: flex; align-items: center; gap: 6px; min-width: 0; }
.crumb {
@@ -96,6 +97,52 @@
.tab-group button:hover { background: var(--surface); color: var(--fg-2); }
.tab-group button.active { background: var(--accent-soft); color: var(--accent-2); }
/* Source filter */
.source-filter-wrap { position: relative; }
.filter-btn {
display: inline-flex; align-items: center; gap: 6px;
height: 26px; padding: 0 10px;
border: 1px solid var(--hairline-strong); border-radius: 5px;
background: var(--surface); color: var(--fg-2);
font-size: 11.5px; font-weight: 500; cursor: pointer;
transition: all 0.12s;
}
.filter-btn:hover { background: var(--surface-strong); color: var(--fg); border-color: var(--hairline-vivid); }
.filter-btn.active { border-color: rgba(167,139,250,0.35); background: var(--accent-soft); color: var(--accent-2); }
.filter-btn svg { width: 11px; height: 11px; }
.filter-btn .filter-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; }
.filter-btn.active .filter-label { color: var(--accent); }
.filter-dropdown {
position: absolute; top: calc(100% + 6px); right: 0;
width: 220px; background: rgba(20, 22, 38, 0.98);
backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
border: 1px solid var(--hairline-strong); border-radius: 8px;
box-shadow: 0 12px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
opacity: 0; transform: translateY(-4px);
pointer-events: none; transition: all 0.15s;
z-index: 100; padding: 6px;
}
.filter-dropdown.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.fd-row {
display: flex; align-items: center; gap: 10px;
padding: 8px 10px; border-radius: 5px; cursor: pointer;
transition: background 0.08s;
}
.fd-row:hover { background: rgba(255,255,255,0.03); }
.fd-row .fd-check {
width: 14px; height: 14px;
border: 1.5px solid var(--muted-2); border-radius: 3px;
flex-shrink: 0; display: grid; place-items: center;
transition: all 0.1s;
}
.fd-row.checked .fd-check { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }
.fd-row .fd-check svg { width: 10px; height: 10px; color: var(--bg); opacity: 0; }
.fd-row.checked .fd-check svg { opacity: 1; }
.fd-row .fd-name { font-size: 12.5px; color: var(--fg-2); flex: 1; }
.fd-row.checked .fd-name { color: var(--fg); }
.fd-divider { height: 1px; background: var(--hairline); margin: 4px 6px; }
.toolbar-action-primary {
display: inline-flex; align-items: center; gap: 5px;
height: 26px; padding: 0 12px;