feat(FN-3708): restore narrow logs/system mouse auto-toggle policy and docu
The merge delivers three feature themes: FN-3708 restores and tests a narrow logs/system mouse auto-toggle policy in the TUI app with documentation, FN-3087 adds immediate wake controls for the agent inbox and messaging API routes, and FN-3704 separates plugin lifecycle management from setup probe s Fusion-Task-Id: FN-3708
This commit is contained in:
@@ -728,6 +728,38 @@ describe("StatsPanel memory row", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("Narrow status-mode mouse policy", () => {
|
||||
it("enables mouse mode on Logs and disables it again on System", async () => {
|
||||
const controller = newController();
|
||||
controller.setSystemInfo(makeSystemInfo());
|
||||
controller.log("entry", "scope");
|
||||
|
||||
const rendered = render(renderDashboardAppNode(controller));
|
||||
setTerminalSize(rendered, 60, 24);
|
||||
rendered.rerender(renderDashboardAppNode(controller));
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(controller.getSnapshot().mouseEnabled).toBe(false);
|
||||
});
|
||||
|
||||
rendered.stdin.write("2");
|
||||
await vi.waitFor(() => {
|
||||
const snapshot = controller.getSnapshot();
|
||||
expect(snapshot.activeSection).toBe("logs");
|
||||
expect(snapshot.mouseEnabled).toBe(true);
|
||||
});
|
||||
|
||||
rendered.stdin.write("1");
|
||||
await vi.waitFor(() => {
|
||||
const snapshot = controller.getSnapshot();
|
||||
expect(snapshot.activeSection).toBe("system");
|
||||
expect(snapshot.mouseEnabled).toBe(false);
|
||||
});
|
||||
|
||||
rendered.unmount();
|
||||
});
|
||||
});
|
||||
|
||||
describe("LogsPanel narrow formatting", () => {
|
||||
it("shows a compact index instead of full timestamp in narrow terminals", async () => {
|
||||
const controller = newController();
|
||||
|
||||
@@ -4141,13 +4141,15 @@ export function DashboardApp({ controller }: DashboardAppProps) {
|
||||
// When a log entry is expanded, disable mouse reporting so the user can
|
||||
// click-drag to select the message text natively. Esc/Enter closes the
|
||||
// expanded view and the policy reapplies, restoring wheel scrolling.
|
||||
const statusLogsFocused = state.activeSection === "logs"
|
||||
// Narrow-mode split keeps wheel scrolling for the bottom log strip,
|
||||
// except when System is selected (preserve native text selection).
|
||||
|| (state.narrowLogSplitFocused && state.activeSection !== "system");
|
||||
const wantsMouse = state.mode === "interactive"
|
||||
? (state.interactiveView === "files"
|
||||
|| state.interactiveView === "git"
|
||||
|| state.interactiveView === "board")
|
||||
: ((state.activeSection === "logs"
|
||||
|| (state.narrowLogSplitFocused && state.activeSection !== "system"))
|
||||
&& !state.logsExpandedMode);
|
||||
: (statusLogsFocused && !state.logsExpandedMode);
|
||||
useEffect(() => {
|
||||
if (state.mouseEnabled !== wantsMouse) {
|
||||
controller.setMouseEnabled(wantsMouse);
|
||||
|
||||
Reference in New Issue
Block a user