7467add484
- Removed title-source aware branching from session terminal-title and accent helpers, and updated callers to use session name plus cwd only. - Dropped UUID-based recent-session naming by preferring explicit header titles or first user prompts and generating an "Untitled · <time>" fallback. - Adjusted welcome session-row rendering for width-aware name truncation and disabled reasoning in title generation requests to keep terminal titles concise.
20 lines
744 B
TypeScript
20 lines
744 B
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import { getSessionAccentHex } from "../src/utils/session-color";
|
|
import { formatSessionTerminalTitle } from "../src/utils/title-generator";
|
|
|
|
describe("getSessionAccentHex", () => {
|
|
it("returns a stable hex for the same name", () => {
|
|
expect(getSessionAccentHex("Named session")).toBe(getSessionAccentHex("Named session"));
|
|
});
|
|
});
|
|
|
|
describe("formatSessionTerminalTitle", () => {
|
|
it("uses the session name when present", () => {
|
|
expect(formatSessionTerminalTitle("Manual title", "/work/pi")).toBe("π: Manual title");
|
|
});
|
|
|
|
it("falls back to the cwd basename when the session name is missing", () => {
|
|
expect(formatSessionTerminalTitle(undefined, "/work/pi")).toBe("π: pi");
|
|
});
|
|
});
|