Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Foreground daemon: `python -m emrg`.

- Python: `uv run pytest tests/ -v` — re-count with `uv run --no-sync python3 scripts/check-doc-count.py --measure`. Import check: `uv run python -c "from emrg.client.app import run_client"`
GUI: `cd emrg/gui && npm test` (279: 107 daemon_client + 22 conn-manager + 7 integration + 7 nav-policy + 11 gui-state + 9 build-config + 10 config_fields + 16 boot-contract + 3 preload-api + 2 theme-guard + 2 image-hash + 8 switch-session + 19 atp_login + 4 gui-op-log + 9 theme-setting + 5 window-title + 4 frame-route + 11 browser-policy + 5 browser-wiring + 13 settings_store + 5 preview-annotation-wiring) — syntax: `node --check main.js preload.js daemon_client.js`
Renderer: `cd emrg/gui/renderer && npm run typecheck && npm test` (1282: 5 snapshot-store + 13 utils + 3 ErrorBoundary + 2 App + 12 commands + 4 copywriting + 14 i18n + 33 markdown + 22 selection + 41 transcript + 11 conversationType + 4 MarkdownText + 65 TranscriptView + 22 history + 30 historyReplay + 8 userImages + 43 composer + 97 Composer + 14 sidebar + 32 workspaceView + 18 WorkspaceView + 10 dialog + 6 Dialog + 9 ConfirmDialog + 9 RenameDialog + 13 dialogLists + 3 HelpDialog + 9 MemoryDialog + 8 SkillsDialog + 8 openSession + 6 WelcomeDialog + 20 OpenSessionDialog + 14 NewSessionDialog + 7 rewind + 8 RewindDialog + 7 GithubDeviceDialog + 82 daemonBridge + 13 DaemonBridgeProvider + 68 Shell + 19 page + 51 EditorPanel + 25 DialogHost + 48 SettingsPanel + 18 TaskFormDialog + 5 RantDialog + 8 vendorMarkdown + 10 highlightTheme + 8 ApprovalDialog + 20 SandboxRootsDialog + 42 cockpit + 4 editorSelectionCascade + 9 fileTree + 24 FileTree + 5 contextMenu + 1 residue + 24 StatusBand + 24 UsageRanking + 9 usageRanking + 6 SearchOverlay + 5 ResizeHandle + 8 IconRail + 6 SessionColumn + 5 EmrgMark + 38 editorDoc + 27 CodeEditor + 26 annotation + 14 AnnotationMode)
Renderer: `cd emrg/gui/renderer && npm run typecheck && npm test` (1283: 5 snapshot-store + 13 utils + 3 ErrorBoundary + 2 App + 12 commands + 4 copywriting + 14 i18n + 33 markdown + 22 selection + 41 transcript + 11 conversationType + 4 MarkdownText + 65 TranscriptView + 22 history + 30 historyReplay + 8 userImages + 43 composer + 97 Composer + 14 sidebar + 32 workspaceView + 18 WorkspaceView + 10 dialog + 6 Dialog + 9 ConfirmDialog + 9 RenameDialog + 13 dialogLists + 3 HelpDialog + 9 MemoryDialog + 8 SkillsDialog + 8 openSession + 6 WelcomeDialog + 20 OpenSessionDialog + 14 NewSessionDialog + 7 rewind + 8 RewindDialog + 7 GithubDeviceDialog + 82 daemonBridge + 13 DaemonBridgeProvider + 69 Shell + 19 page + 51 EditorPanel + 25 DialogHost + 48 SettingsPanel + 18 TaskFormDialog + 5 RantDialog + 8 vendorMarkdown + 10 highlightTheme + 8 ApprovalDialog + 20 SandboxRootsDialog + 42 cockpit + 4 editorSelectionCascade + 9 fileTree + 24 FileTree + 5 contextMenu + 1 residue + 24 StatusBand + 24 UsageRanking + 9 usageRanking + 6 SearchOverlay + 5 ResizeHandle + 8 IconRail + 6 SessionColumn + 5 EmrgMark + 38 editorDoc + 27 CodeEditor + 26 annotation + 14 AnnotationMode)
- CI: pytest on ubuntu **and windows-2025**, the GUI suites, and an actionlint gate over `.github/workflows/`; re-trigger a dropped push with `scripts/re-trigger-ci.sh <branch>`, never an empty commit
- Merge gates, run before merging — `uv run --no-sync python3 scripts/check-vote-count.py` · `scripts/check-pr-base.py` · `scripts/check-merge-freshness.py` · `scripts/check-merge-order.py` · `scripts/check-merge-landing-diff.py` · `scripts/check-merge-pairs.py` / `scripts/check-merge-sequence.py` · `scripts/check-merge-tree-health.py` (the merged tree passes one guard) · `scripts/check-merge-plan-suite.py` — all under `uv run --no-sync python3`
- Post-merge audit: `uv run --no-sync python3 scripts/check-merge-landed.py <N>` (did it land the reviewed tree)
Expand Down
20 changes: 20 additions & 0 deletions emrg/gui/renderer/src/components/Shell.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,22 @@ describe("Shell — 会话信息行 + /指令接线(rant 2026-09-01T20:16:55 /
* the seam instead: a real `Shell`, a fake preload, a click on a row, and the panel's own
* DOM as the only witness.
*/
describe("the right column's opening state (host, 2026-12-03)", () => {
it("新打开时右栏是关的,状态带上那个开关一按才出现", async () => {
const m = mockEmrg();
render(wrapper(<Shell />));
await waitFor(() => expect(m.onEvent).toHaveBeenCalledTimes(1));
expect(screen.getByTestId("status-band")).toBeInTheDocument();
// 关着的时候它连挂载都不该有:留在树里只是不显示,就等于还在占位置、还在读文件。
expect(screen.queryByTestId("inspector-aside")).toBeNull();
fireEvent.click(screen.getByTestId("band-toggle-right"));
expect(await screen.findByTestId("inspector-aside")).toBeInTheDocument();
// 再按一次收回去,和打开对称。
fireEvent.click(screen.getByTestId("band-toggle-right"));
await waitFor(() => expect(screen.queryByTestId("inspector-aside")).toBeNull());
});
});

describe("the cockpit's file-row wire (issue #3070)", () => {
it("点左栏的文件行 → 右栏开一个标签,读的是这一行的绝对路径,正文真的到了面板上", async () => {
const m = mockEmrg();
Expand All @@ -1692,6 +1708,10 @@ describe("the cockpit's file-row wire (issue #3070)", () => {
await waitFor(() => expect(m.onEvent).toHaveBeenCalledTimes(1));
m.emit(openSessionsFrame([{ sid: "s1", title: "Alpha" }], "s1"));

// 右栏一开始是关的(宿主 2026-12-03),面板没挂载也就没有把手 —— 下面这一行
// 证明「点文件」自己是把右栏打开的,不是靠它本来就在。
expect(screen.queryByTestId("inspector-aside")).toBeNull();

// agent 目录默认收起(rant 2026-11-20T17:56:07 清单 2):先展开再点行
fireEvent.click(await screen.findByTestId("left-group-agent-row"));
const row = await screen.findByTestId("left-tree-agent-row");
Expand Down
24 changes: 22 additions & 2 deletions emrg/gui/renderer/src/components/Shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ export function Shell() {
const [leftWidth, setLeftWidth] = useState(() => storedColumnWidth(LS_LEFT_WIDTH, LEFT_COLUMN_DEFAULT));
const [rightWidth, setRightWidth] = useState(() => storedColumnWidth(LS_RIGHT_WIDTH, RIGHT_COLUMN_DEFAULT));
const [leftOpen, setLeftOpen] = useState(true);
const [rightOpen, setRightOpen] = useState(true);
// The right column starts closed (host, 2026-12-03): it holds the file editor, which is
// something the host asks for on purpose, so the conversation keeps the width until then.
// Nothing remembers this choice — closed is the beginning of every launch, and opening a
// file from the session column is what opens it.
const [rightOpen, setRightOpen] = useState(false);
const [searchOpen, setSearchOpen] = useState(false);
// The window width is read once and then tracked: the left column's ceiling is what
// the window leaves the body, so it has to be a live number, not a constant.
Expand Down Expand Up @@ -747,9 +751,25 @@ export function Shell() {
// The editor's tabs are opened from the session column's trees, so this column needs a
// handle on the panel that owns them (issue #3068).
const editorRef = useRef<EditorPanelHandle | null>(null);
// A column that is closed has no panel mounted, so it has no handle either: a file picked
// in the session column would be handed to nothing. The request waits here for the one
// render it takes the column to open, and opening it is what mounts the panel.
const pendingEditorOpen = useRef<{ path: string; root: string; preview: boolean } | null>(null);
const openFileInEditor = useCallback((req: { path: string; root: string; pin: boolean }) => {
editorRef.current?.openFile({ path: req.path, root: req.root, preview: !req.pin });
const open = { path: req.path, root: req.root, preview: !req.pin };
if (editorRef.current) {
editorRef.current.openFile(open);
return;
}
pendingEditorOpen.current = open;
setRightOpen(true);
}, []);
useEffect(() => {
const pending = pendingEditorOpen.current;
if (!rightOpen || !pending || !editorRef.current) return;
pendingEditorOpen.current = null;
editorRef.current.openFile(pending);
}, [rightOpen]);

/**
* The whole register's sessions, fetched each time the overlay opens (issue #2978).
Expand Down
Loading