Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/views/codeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,15 @@ export class CodeView extends ItemView {
// ---- Usage --------------------------------------------------------------

private async renderUsageTab(body: HTMLElement): Promise<void> {
body.empty();

const bar = body.createDiv({ cls: "libra-toolbar" });
bar.createSpan({ cls: "libra-section-title", text: "Token & cost usage" });
const refresh = bar.createEl("button", { cls: "clickable-icon", attr: { "aria-label": "Refresh" } });
setIcon(refresh, "refresh-cw");
refresh.onclick = () => void this.renderUsageTab(body);

const list = body.createDiv();
// remove any previous content below the toolbar
while (bar.nextSibling) bar.nextSibling.remove();
body.appendChild(list);

list.createDiv({ cls: "libra-muted", text: "Loading usage…" });
try {
Expand Down Expand Up @@ -157,15 +156,15 @@ export class CodeView extends ItemView {
// ---- Automation ---------------------------------------------------------

private async renderAutomationTab(body: HTMLElement): Promise<void> {
body.empty();

const bar = body.createDiv({ cls: "libra-toolbar" });
bar.createSpan({ cls: "libra-section-title", text: "Automation rules" });
const refresh = bar.createEl("button", { cls: "clickable-icon", attr: { "aria-label": "Refresh" } });
setIcon(refresh, "refresh-cw");
refresh.onclick = () => void this.renderAutomationTab(body);

const list = body.createDiv();
while (bar.nextSibling) bar.nextSibling.remove();
body.appendChild(list);

list.createDiv({ cls: "libra-muted", text: "Loading automation rules…" });
try {
Expand Down