Merge pull request #15 from runbear-io/feat/insights-landing-notes

feat: expandable history notes + Insights as project landing
This commit is contained in:
Snow W. Lee (Sungwon)
2026-07-12 12:54:29 -07:00
committed by GitHub
2 changed files with 21 additions and 2 deletions
+18 -1
View File
@@ -166,7 +166,12 @@ function selectProject(p, path) {
initUpload();
initHistory();
updateShareButton();
refreshTree().then(() => { if (path) openPath(path); });
refreshTree().then(() => {
if (path) openPath(path);
// Landing view: admins/owners get the Insights dashboard instead of an
// empty "select a file" pane; members keep the placeholder.
else if (canSeeInsights()) showInsights();
});
if (!path) pushURL("/" + p.id);
}
@@ -1543,6 +1548,18 @@ function historyEntryRow(e) {
note.append(tok);
}
}
// Long notes clamp to one line; clicking the note (links still work)
// expands to the full text and back.
note.tabIndex = 0;
note.setAttribute("role", "button");
note.title = "Show full note";
note.onclick = (ev) => {
if (ev.target.tagName === "A") return;
const open = note.classList.toggle("open");
note.title = open ? "Collapse note" : "Show full note";
note.setAttribute("aria-expanded", String(open));
};
note.onkeydown = (ev) => { if (ev.key === "Enter" || ev.key === " ") { ev.preventDefault(); note.click(); } };
row.appendChild(note);
}
const p = e.path;
+3 -1
View File
@@ -347,7 +347,9 @@ button, input, a.btn { font-family: inherit; }
.hact { margin-left: auto; }
.hact a { color: var(--accent-bright); text-decoration: none; margin-left: 10px; }
.hact a:hover { text-decoration: underline; }
.hnote { margin-top: 4px; padding-left: 23px; font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hnote { margin-top: 4px; padding-left: 23px; font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.hnote:hover { color: var(--text); }
.hnote.open { white-space: normal; overflow-wrap: anywhere; }
.hnote::before { content: " "; color: var(--text-ghost); }
.hnote a { color: var(--accent-bright); text-decoration: none; }
.hnote a:hover { text-decoration: underline; }