deddf71d7b
Add a rich-text formatting toolbar as the focus-mode header when the WYSIWYG editor is active: heading dropdown, bold/italic/code, lists, and link, with a priority+overflow responsive layout and live active-state highlighting. The toolbar is a self-contained component driven through a new FormattingController surface routed via EditorContent. Remove the now-redundant slash-command feature (/todo, /code, /link, /table) and its "Type / for commands" hint, since the toolbar covers those actions; the shared suggestion renderer stays for #tag.
18 lines
639 B
TypeScript
18 lines
639 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { COMPACT_TOOLBAR_WIDTH, isCompactWidth } from "@/components/MemoEditor/hooks/useElementWidth";
|
|
|
|
describe("isCompactWidth", () => {
|
|
it("treats an unmeasured (0) width as not compact (full layout default)", () => {
|
|
expect(isCompactWidth(0)).toBe(false);
|
|
});
|
|
|
|
it("is compact below the threshold", () => {
|
|
expect(isCompactWidth(COMPACT_TOOLBAR_WIDTH - 1)).toBe(true);
|
|
});
|
|
|
|
it("is not compact at or above the threshold", () => {
|
|
expect(isCompactWidth(COMPACT_TOOLBAR_WIDTH)).toBe(false);
|
|
expect(isCompactWidth(COMPACT_TOOLBAR_WIDTH + 200)).toBe(false);
|
|
});
|
|
});
|