nigig-org/README.md
andodeki 23fce675de
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
Payment domain, storage, platform and UI / isolated-payment-tests (push) Has been cancelled
Payment domain, storage, platform and UI / payment-ui-tests (push) Has been cancelled
feat(pay): USSD automation on by default; containment moves to packaging
Option A, as requested. Plus an audit of the whole review against the code.

## The default flips

  nigig-pay-ui   default = []            (leaf stays off; see below)
  nigig-pay      default = ["demo"]
  nigig-mpesa    default = ["demo"]
  pageflipnav    default = ["native", "demo"]

`cargo run -p pageflipnav` now drives *334#, shows the PIN field and
dispatches. That is the app's primary function and it works out of the box.

A release build opts out:

  cargo build -p pageflipnav --no-default-features --features native

This was not one line. A first attempt flipped the four `default =` lines
and the opt-out still leaked: the app crates depended on nigig-pay-ui with
its own defaults, so `--no-default-features` on pageflipnav was silently
re-enabled one level down. Verified with a compile probe rather than
cargo tree, which truncates. The inner deps now carry
`default-features = false`, and the probe confirms both directions:
default -> demo ON, --no-default-features -> demo OFF.

ADR 0007's Play-policy note is untouched. The containment requirement of
review item 0.1 is not dropped — the flag exists, CI exercises both
directions, and a shipped build still cannot dispatch. What changed is
which way it points by default, so development and device testing are not
fighting it.

CI guards inverted to match: they now assert automation is on by default
*and* that the packaging opt-out still works. check-no-pin-capture.sh now
probes the packaging build, since the default legitimately captures a PIN.

## REVIEWS/IMPLEMENTATION_AUDIT.md

Every phase checked against the code, not against the tranche notes. Where
they disagreed the code won. Summary: phases 0-5 and 7 done bar 5.2 and
Keystore provisioning; phase 6 substantially done with the thread_local
session ownership outstanding; phase 8 partly.

## B7 found live while auditing

Month navigation had never been examined. Both copies of the transactions
widget still stepped months with Duration::days(31) and years with
Duration::days(366). Reproduced before touching it:

  2025-12-28 -1 month => 2025-11-27   (drifts a day)
  2026-03-30 -1 month => 2026-02-27   (drifts; repeated steps skip a month)
  2027-06-15 +1 year  => 2028-06-15   (366d wrong on a non-leap year)

Now uses checked_add_months/checked_sub_months, which clamp to the end of
the target month, and checked_add_signed on the day path. An
unrepresentable date leaves the view where it was.

Neither claimed done nor flagged open — simply never looked at. That is the
argument for auditing code rather than notes.

## Validation

  domain 137 / storage 41 / platform 64 / mpesa 29 / pay-ui 61   pass
  cargo check: pay-ui, pay, mpesa, core (default and opt-out)    pass
  demo-on-by-default probe, both directions                      pass
  no-PIN-capture guard against the packaging build               pass

Unrelated and still blocking a full APK: nigig-map fails to compile on
clean HEAD (12 errors, no field center_lat on ViewportState).
2026-08-02 08:06:43 +00:00

13 KiB
Raw Permalink Blame History

nigig-org

cargo makepad android --manifest --app-label="PFN" --abi=aarch64 run -p pageflipnav --release
cargo makepad android adb logcat -d | grep -A80 -B20 -E "FATAL EXCEPTION|beginning of crash|thread panicked|Makepad|Abort message"

cargo run -p pageflipnav --release -- --hot

the pich to zomm does not work still you have not implemented the overlay effect on top of the map the rider1 image is not implemented when we first load into rider screen we need to pull the location api to load the map as per the user location current location be detected and the map to load at the said location

now the plan for this whole code base is that each crate should have its own standalone navbar since we should be able to run each crate nigigi-* as a stanalone app except for nigig-core/nigig-uikit. Then pageflipnav can run them all in one app where we have the navbar define in pageflivnav crate/main app, but when compiling say nigig-rider and any of nigig-* app except *-core and -uikit the bottom bar for the respective app do not show up which should show up to be able to navigate the single app when compiled. so we should have each of nigig- respective nav item show in the respective cratea and when we are compiling for pageflipnav app they should aslo show up as nav items for navigation.

now we shall have a dilema where in the pageflip app nav current pulling up the bottom sheet we have the the navigation sheet to Mobility | Profile | Preferences

Component Status
Table Phase 1 (static rendering) ✅ Done
Table Phase 2 (hover + cell editing) ✅ Done
doc-model ✅ Done (with tests)
pdf-export ✅ Done (minimal B&W, both fonts embedded)
invoicer UI Phase 1 ✅ Done (load + display + export, line-item editing)
invoicer UI Phase 2 ⏳ Editable header fields, currency/tax pickers, doc switcher
invoicer UI Phase 3 ⏳ File browser, search, recent docs
Table Phase 3+ ⏳ PopupMenu, drag-reorder, LaTeX cells

also a button besides the phone input to access phone books to search for number or select a number from phonebook to send, also where is the network status indicator to be shown on the page for network bars and status some transaction requests may not proceed especially in concrete heavy settlement where network is poor 334 dialing may not happend so we need to give the status and the transaction retry in the background be triggered and for the transaction to proceed if we need to for phonebook we have the sms app which tries to syncnronise sms recepients and there names if we dont have robius contacts we create it and wire it up we can allow a dektop or wasm makepad app to send a message since we cannot diall in a desktop context unless we a modem connected

also investigate the searchable combox box used at the home page why item do not scroll on touch or mouse interactions

we should also have a dropdown pill which is persistence at at pages at the top left of the app mobile screen showing the user account avator and dropdown for user account/and projects created so the user can easiliy switch between projects which will govern which apps or crates will be shown since in project creation will suggest which apps to use for the said project and the user can cycle through them at this pill

cp -rf crates/apps/nigig-pay-ui/nigig_solution/nigig-pay-ui/* crates/apps/nigig-pay-ui
&& cp -rf crates/apps/nigig-pay-ui/nigig_solution/nigig-mpesa/* crates/apps/nigig-mpesa
&& cp -rf crates/apps/nigig-pay-ui/nigig_solution/nigig-pay/* crates/apps/nigig-pay
&& cp -rf crates/apps/nigig-pay-ui/nigig_solution/nigig-core/* crates/nigig-core
&& cp -rf crates/apps/nigig-pay-ui/nigig_solution/nigig-uikit/* crates/nigig-uikit
&& clear && cargo makepad android --manifest --app-label="PFN" --abi=aarch64 run -p pageflipnav --release

# Verify a Cloudflare token. Supply it via the environment; never inline it.
curl "https://api.cloudflare.com/client/v4/user/tokens/verify" \
  -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"

eb2c0657ac11f1b4d8056280da4acee0

https://t.co/I06wzl3TnF

the mobile app the 3d object seems transparent. the 2faces of a cube facing the screen to the human eye is transparent but the 2 behind faces in this view of the cube seem opaque.

but desktop app the cube or objects are all solid

also we can create a dropdown like in revit to see the objects in wireframe, solid, colored, real

also the sync is only working in desktop and not in mobile app

Phase 1: Change the parts field type from Vec to Vec in mod.rs, but keep ScenePart as a compatibility wrapper. Add conversion methods so existing code continues to work.

Phase 2: Gradually migrate each method to use CadNode fields directly.

Phase 3: Delete ScenePart and scene_conversion.rs.

Mostly yes.

From the current codebase and the comparison document you shared, many of the originally proposed architectural features are already implemented, while a few remain partially implemented or are still missing.

Feature Status
Immutable CAD scene ✅ Implemented
Export abstraction (GLTF/PDF) ✅ Implemented
Visitor-based traversal ✅ Implemented
Mesh cache ✅ Implemented (could use parameter hashing)
Strong typed scene IDs ✅ Implemented
Multi-selection ✅ Implemented
Properties panel ✅ Implemented
Split 2D/3D workspace ✅ Implemented
Construction geometry ✅ Implemented
Work planes (XY/XZ/YZ) ✅ Implemented
Extrusion workflow ✅ Implemented
Axis grids & story levels ✅ Implemented
AutoCAD coordinate parser 🟡 Partially implemented
Grid snap ✅ Implemented
Endpoint/Midpoint snap ✅ Implemented
Perpendicular/Nearest/Intersection snap 🟡 UI exists, snapping logic incomplete
Dynamic tool system ✅ Implemented
Rubber-band drawing ✅ Implemented
Hover highlighting ✅ Implemented
Marquee selection ✅ Implemented

Building the payment apps

Default build — USSD automation enabled

cargo run -p pageflipnav --features demo   # equivalent: automation is default-on
cargo run -p pageflipnav                   # same thing

pageflipnav is the crate that produces the APK. A default build drives the *334# menu through the AccessibilityService, shows the M-Pesa PIN field, and dispatches payments. This is the app's primary function and it works out of the box.

USSD only has a real backend on Android. On Linux, macOS and Windows every call returns PermanentlyUnavailable, so dispatch cannot work there regardless of flags. The device also needs the USSD AccessibilityService enabled in system settings.

Packaging build — tracker only, no PIN capture

cargo build -p pageflipnav --no-default-features --features native

This produces a build that never dials USSD and in which the PIN field is not compiled at all (form_pin does not exist; asserted by tools/check-no-pin-capture.sh). The Pay sheet reports that automation is off and points the user at the M-Pesa app.

Use this for any build you intend to publish. AccessibilityService-driven USSD automation is an unresolved Google Play policy risk — enforcement is app removal and developer-account termination, and it is retroactive. See review item 5.2 and ADR 0007.

Containment is a packaging decision, not a default. Review item 0.1 asked for dispatch behind a compile-time flag; that flag exists and is exercised by CI in both directions. What changed is which way it points by default, so that ordinary development and device testing are not fighting it.

Native libraries (Linux)

Makepad needs system libraries to compile, and a few more to link a test binary:

./tools/makepad-native-libs.sh --check     # report what is missing
./tools/makepad-native-libs.sh --install   # opt-in, apt-based

Omitting the audio/SSL packages produces a confusing unable to find library -lasound long after the compile appears to succeed.

Tests

TEST_TARGET=domain   ./tools/test-rust-clean.sh
TEST_TARGET=storage  ./tools/test-rust-clean.sh
TEST_TARGET=platform ./tools/test-rust-clean.sh
./tools/test-mpesa-store-clean.sh
cargo test -p nigig-pay-ui --lib

Still missing

These are the biggest gaps I see:

  • ❌ Arc drawing tool
  • ❌ Area/shell drawing tools (polygon → slab/surface)
  • ❌ Chamfered slab tool
  • ❌ Inclined UCS / arbitrary work plane
  • ❌ True ray-cast picking (currently projection-based)
  • ❌ 3D Revit-style axis bubble labels
  • ❌ Polar tracking mode (45° independent of ortho)
  • ❌ Grid snap step selector
  • ❌ Auto-focus Direct Distance Entry (AutoCAD-style typing while drawing)
  • ❌ Hover information tooltip
  • ❌ Command-based undo/redo
  • ❌ Async exporters
  • ❌ SceneBuilder API
  • ❌ Full removal of the legacy ScenePart compatibility layer

Architecturally

Compared to the original review, you've already completed roughly 80–90% of the major refactor:

  • ✅ Scene graph
  • ✅ Export abstraction
  • ✅ Visitor pattern
  • ✅ Cached geometry
  • ✅ Modern workspace
  • ✅ Tool system
  • ✅ Construction aids
  • ✅ Reference planes
  • ✅ Multi-selection
  • ✅ Properties editing

The remaining work is primarily CAD UX and editor polish, not core architecture.

What I'd prioritize next

  1. Implement the three remaining OSnaps (Perpendicular, Nearest, Intersection).
  2. Replace projection-based picking with true ray casting.
  3. Add Arc and Area drawing tools.
  4. Add an inclined (3-point) work plane/UCS.
  5. Finish the migration away from the legacy ScenePart representation.
  6. Introduce a command-based undo/redo system.
  7. Add 3D axis bubbles and hover tooltips.

At this point, I would focus almost entirely on editor functionality rather than additional architectural refactoring, because the core architecture is already in good shape.

Refined priority order I'd suggest

#1 Exporter trait — pure refactor, no behavior change, unlocks STL/OBJ/SVG immediately.
#9 Visitor pattern — comes for free with #1, do them in one PR.
#7 + #2 Strong IDs + immutable CadScene — the foundation everything else needs.
#3 Mesh cache — only meaningful after #2.
#4 Incremental regeneration — only after profiling.
#5 Parallel mesh gen — only after Send/Sync audit of makepad_csg.
#6 Arena allocation — only if scene grows past ~10k nodes.
#10 Streaming execution — UX win, lower priority than perf.
#8 Builder API — ergonomic, do alongside #2.
#10 Command pattern (undo/redo) — important but separable from perf.


cad/
mod.rs                  — re-exports + module wiring only (~200 lines)
cad_scene.rs            — (already split out)
arch_gltf.rs            — (already split out)
arch_pdf.rs             — (already split out)
cad_editor_sheet.rs     — (already split out)
viewport.rs             — CadViewport widget + 3D drawing + camera (~4k lines)
viewport_2d.rs          — 2D plan view mode + projections (~1.5k lines)
tools.rs                — CadTool enum + DrawingState + SnapSettings + tool dispatch (~2k lines)
script_bindings.rs      — cad_script_mod() + Solid handle types + VM method registry (~1.5k lines)
commands.rs             — CadCommand + undo/redo stack + the future `trait Command` (~500 lines)
persistence.rs          — save/load + cad_store integration + path helpers (~500 lines)
scene_conversion.rs     — parts_to_scene() + ScenePart::to_cad_node() bridge (~300 lines)
exporters.rs            — export_floor_plan_pdf + export_3d_viewer + export_cli_script + bake entry points (~500 lines)
construction_geometry.rs — construction lines + points + measurement overlay (~500 lines)