ReviewOS

craft-native/craft

Three inert menu implementations shadow the real one, and the tests exercise the inert one

#31
Closed glennmichael123 opened this 22 days ago · 0 comments
22 days ago

Found while wiring the menu bridge (#27/#29). The repo contains three menu implementations that produce nothing, sitting beside the one that runs (bridge_menu.zig):

  • packages/zig/src/native_menu.zig — buildStandardMenu() builds a complete File/Edit/View/Window/Help structure with accelerators. Nothing imports this module into the live path.
  • packages/zig/src/menu.zig — createStandardMenuBar() returns a pure-data struct; its buildMacOS() is an explicit placeholder ("Implementation will use macOS NSMenu APIs"). main.zig imports it and never uses it.
  • packages/zig/test/menu_test.zig — tests createStandardMenuBar against that inert data structure, so the menu tests pass while no menu is produced.

This combination is how the #27 contract mismatch and the #29 dead selector survived: the only exercised test (bridge.test.ts) constructs bridge messages by hand rather than going through craft-bridge.js, and the zig tests validate a struct nothing renders.

Suggest: delete native_menu.zig and menu.zig (salvaging buildStandardMenu's content into the default-menu work if wanted), retire menu_test.zig with them, and add one test that goes through the real path — craft-bridge.js's menu.set → bridge_menu.zig's parser.

🤖 Generated with Claude Code

Sign in to comment on this issue.