Skip to content

Move rebuild into the Leaflet menu and sidebar icon row - #2

Merged
imann24 merged 3 commits into
mainfrom
codex/compact-rebuild-controls
Oct 7, 2026
Merged

imann24 merged 3 commits into
mainfrom
codex/compact-rebuild-controls

Conversation

@imann24

@imann24 imann24 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

The full-width Rebuild app button consumed an extra row in the sidebar. Replace it with a hammer icon beside Refresh and Choose Folder, with an accessible label and tooltip, and add Rebuild app… under the native macOS Leaflet menu. Both controls open the existing rebuild dialog; the command palette action remains available. Update the README to describe the controls.

Validation:

  • pnpm build and pnpm format:check passed.
  • pnpm test: 27 tests passed.
  • pnpm test:e2e: 22 tests passed.
  • cargo test --locked --manifest-path src-tauri/Cargo.toml: 13 passed, 1 intentionally ignored.
  • cargo fmt --manifest-path src-tauri/Cargo.toml -- --check passed.
  • Checked the compact footer at 850 × 600 and verified the native menu event opens the rebuild dialog using the desktop IPC harness.

The native menu update takes effect after rebuilding the desktop app.

@eve-code-review-imann24

Copy link
Copy Markdown

starting review...

@eve-code-review-imann24 eve-code-review-imann24 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moves the Rebuild control into a hammer icon in the sidebar footer and adds a native macOS "Rebuild app…" menu item that opens the same dialog.

Findings: 0 blockers, 1 should-fix, 1 nit.

Docs checked: no wiki or ticket was available for this repo, so I found no linked spec or conventions. I checked src-tauri/capabilities/default.json myself. core:default already covers listen, so no new permission is needed. The existing e2e specs click Rebuild app by accessible name, and the new icon button keeps that name.

Comment thread src/App.tsx
useEffect(() => {
void load(readPreference<string>('root', ''));
}, [load]);
useEffect(() => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should-fix: The new open-rebuild listener, which is the only path the native menu uses, has no automated test. The PR says it was checked by hand with the IPC harness. tests/fixtures/desktop.ts already imports emit from @tauri-apps/api/event, so a small case in tests/rebuild.spec.ts could emit open-rebuild and assert the dialog opens. That would stop this from regressing silently. The Rust side (menu insertion at index 2 and the event id match) is also untested, but that's harder to cover.

Comment thread src-tauri/src/lib.rs
.setup(|app| {
#[cfg(target_os = "macos")]
{
let menu = Menu::default(app.handle())?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The Leaflet submenu is found by comparing its text to app.package_info().name, and the item is inserted at a hard-coded index 2. If the name doesn't match, or the Tauri default menu layout changes, the Rebuild item silently disappears with no log. Consider logging when the submenu isn't found, or adding a comment explaining that index 2 sits just after About and the separator.

@eve-code-review-imann24

Copy link
Copy Markdown

I submitted a single review on PR #2 as a comment. It has one should-fix finding and one nit, and no blockers.

  • Should-fix (src/App.tsx): Nothing automatically tests the new open-rebuild listener, which is the only path the native menu uses. tests/fixtures/desktop.ts already imports emit, so a case in tests/rebuild.spec.ts could emit the event and check that the dialog opens.
  • Nit (src-tauri/src/lib.rs): The Leaflet submenu is found by its text and the item goes in at a fixed index of 2. If either assumption stops holding, the Rebuild item disappears without any log message.

I found no linked ticket, spec or team conventions, because no wiki is configured for this repo. I checked the capabilities file myself. core:default already covers listening for events, so no new permission is needed. The existing e2e specs find the button by its accessible name, which the new icon keeps.

@eve-code-review-imann24

Copy link
Copy Markdown

starting review...

@eve-code-review-imann24 eve-code-review-imann24 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This update adds the e2e test I asked for and a log line when the Leaflet submenu isn't found. The log line covers my earlier nit. The new test has a problem, though.

Findings: 1 blocker, 0 should-fix, 0 nit.

Docs checked: no wiki or ticket is available for this repo, so I found no linked spec or conventions.

Comment thread tests/rebuild.spec.ts Outdated
await expect(
page.getByRole('button', { name: 'Rebuild app', exact: true }),
).toBeVisible();
await emit('open-rebuild');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocker: This emit runs in the Playwright Node process, not in the page. @tauri-apps/api/event's emit invokes window.__TAURI_INTERNALS__, and Node has no window, so the test should throw before the dialog is touched. The mocked IPC and the app's listen only exist in the browser page. tests/fixtures/desktop.ts already has its own emit and exposes window.journalTest. Either add a harness method there, for example openRebuildFromMenu: () => emit('open-rebuild'), and call it with page.evaluate(() => window.journalTest.openRebuildFromMenu()), or call emit inside page.evaluate via the page's module. Then drop the Node-side import on line 2. Please also re-run pnpm test:e2e. The PR description's 21 passing tests predate this test.

@eve-code-review-imann24

Copy link
Copy Markdown

I requested changes on PR #2 at head e29f37e. There is one blocker and nothing else. I didn't run the tests. The blocker comes from reading the test code and the Tauri emit call.

  • Blocker (tests/rebuild.spec.ts, line 70): The new test imports emit from @tauri-apps/api/event and calls it in the Playwright Node process. That call needs window.__TAURI_INTERNALS__, and Node has no window, so the test should throw before it reaches the dialog. The mocked IPC and the app's listener only exist in the browser page. The fix is to emit from inside the page, for example through a new method on the harness in tests/fixtures/desktop.ts called with page.evaluate. I also asked for pnpm test:e2e to be re-run, since the PR's 21 passing tests predate this new test.
  • Earlier findings: The new test addresses my earlier should-fix, but it doesn't work as written. The new "submenu not found" log line in lib.rs addresses the nit.

No wiki or ticket exists for this repo, so I checked no docs.

@eve-code-review-imann24

Copy link
Copy Markdown

starting review...

@eve-code-review-imann24 eve-code-review-imann24 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR replaces the sidebar Rebuild button with a hammer icon and adds a native macOS "Rebuild app…" menu item, and both open the existing rebuild dialog.

The earlier blocker is fixed. The menu-event test now emits from inside the page through a new openRebuildFromMenu harness method. The dialog heading it asserts is <h2>Rebuild app</h2> in RebuildDialog.tsx. The PR now reports 22 passing e2e tests.

Findings: 0 blockers, 0 should-fix, 0 nit.

Docs checked: no wiki or ticket is available for this repo, so I found no linked spec or conventions. I checked src-tauri/capabilities/default.json myself. core:default already covers listen.

@eve-code-review-imann24

Copy link
Copy Markdown

I approved PR #2 at head bc89b12 with no open findings.

The earlier blocker is fixed. The menu-event test now emits from inside the page through a new openRebuildFromMenu method in tests/fixtures/desktop.ts. The heading it checks for is the <h2>Rebuild app</h2> in RebuildDialog.tsx. I didn't run the tests. The PR now reports 22 passing e2e tests, and I'm relying on that figure.

No wiki or ticket exists for this repo, so I checked no docs. I did read src-tauri/capabilities/default.json myself. core:default already covers listen, so no new permission is needed.

@imann24
imann24 merged commit ed737db into main Oct 7, 2026
2 checks passed
@imann24
imann24 deleted the codex/compact-rebuild-controls branch October 7, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant