c8bc4a95a9
Workspace groups: named, foldable, ordered sidebar sections kept per account (agenthub.workspace.groups); a workspace joins one from its menu, a drop on the header, a drag under a row, or Alt+Up/Down past a group's edge; headers drag to reorder; a folded header shows its most urgent state; New workspace in this group; fold/unfold all. Inner repos: GET /api/lanes/:id/repos + ?repo= on git/fs routes; the Changes panel shows a parent folder's repos only when Settings -> Git -> Changes panel turns it on (agenthub.changes.innerRepos, off by default). Cost: the hook writer adds a session's sub-agent transcripts to its tokens and hours (server/lib/subagent-usage.js) — a sub-agent on the session's own model was never counted live (~8% of a week here); an imported session is re-raised on every pass, so a claude -p run first seen with an empty transcript no longer stays at $0 (~10%). A one-time raise-only catch-up (user_version 5) re-reads ~/.claude/projects. Also: omp install script may redirect to its exact install.redirect URL (#85, repo-links test exempts it), native paste in the terminal.
34 lines
1.3 KiB
TypeScript
34 lines
1.3 KiB
TypeScript
/**
|
|
* @file ChangesPanelSettings.test.tsx
|
|
* @description Settings → Git → Changes panel: the inner-repositories switch
|
|
* starts off, turning it on stores `all` in the synced account preference,
|
|
* and turning it off again removes the key (back to the default).
|
|
* @author Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
|
|
*/
|
|
|
|
import { describe, it, expect, beforeEach } from "vitest";
|
|
import { render, screen, fireEvent } from "@testing-library/react";
|
|
import { ChangesPanelSettings } from "../ChangesPanelSettings";
|
|
import { INNER_REPOS_KEY, readInnerReposMode } from "../../../lib/innerReposPref";
|
|
|
|
describe("ChangesPanelSettings", () => {
|
|
beforeEach(() => localStorage.clear());
|
|
|
|
it("is off by default and toggles the account preference", () => {
|
|
render(<ChangesPanelSettings />);
|
|
const sw = screen.getByRole("switch", {
|
|
name: /Show the repositories inside the workspace folder/,
|
|
});
|
|
expect(sw).toHaveAttribute("aria-checked", "false");
|
|
expect(readInnerReposMode()).toBe("own");
|
|
|
|
fireEvent.click(sw);
|
|
expect(localStorage.getItem(INNER_REPOS_KEY)).toBe("all");
|
|
expect(sw).toHaveAttribute("aria-checked", "true");
|
|
|
|
fireEvent.click(sw);
|
|
expect(localStorage.getItem(INNER_REPOS_KEY)).toBeNull();
|
|
expect(readInnerReposMode()).toBe("own");
|
|
});
|
|
});
|