Skip to content

Interface review: board of lamp rows, Export and Import, one Settings window (1.48.0) - #102

Merged
compot-dev merged 3 commits into
mainfrom
interface-review
Nov 18, 2026
Merged

compot-dev merged 3 commits into
mainfrom
interface-review

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

The interface review of the brass look (brass 1.3.0), in the Android app and on the web page, by the approved mock-ups.

Web page

  • The name with the version number to its right; the subtitle "SPI NOR and NAND programmer".
  • A board of rows with a lamp each — ADAPTER, CHIP, STATE, DUMP (link), CAMEX (the app's tunnel) — in place of the lamps and the big display. The bar stays; under it a line with the speed, the chip's warning and the message.
  • Eight buttons, four a row (two on a narrow screen): Detect, Read, Erase, Write / Registers, Self-test, Export…, Import….
    • Export… downloads the dump shown.
    • Import… sends a file to the dump folder as import-NAME.bin, not written to the chip; it becomes the dump shown (link, hex view).
    • Write writes the dump shown, after Detect and a question naming the file; with no dump it asks for a file as before.

Web mode (src/web.c)

  • POST /api/upload (X-MicroSNANDer-Name): the body into the dump folder; the name is reduced to letters, digits, ., -, _, never a path; -2, -3 for the same name; one at a time, not while an operation runs.
  • POST /api/write with no body and X-MicroSNANDer-File: <dump> writes that dump of the dump folder (a regular file, no link, a dump name only); the chip still has to be confirmed.

Android app

  • The header and the board as on the web page, with WEB (the address and a lock: closed with a password, open without) and CAMEX (when the tunnel is on).
  • Nine buttons, three a row: Detect, Read, Erase / Write, Registers, Self-test / Export…, Import…, Settings. The Remote access panel is gone; Allow VPN… shows under the board when the consent is missing.
  • Export… is a brass menu: Save to a file, Share to an app. Import… copies a file into the app's dumps; Write writes the dump shown.
  • One brass SETTINGS window instead of Settings… and Tunnel…: the app's section (Allow remote access, Port, Web page password) and CAMEX (Join a camex server, the fields of the tunnel library). A camex link opened with the app fills it; no link field.
  • Start on boot (remote access after a reboot; an install that had remote access on keeps starting) and Show log (the log of events under the panel), both remembered.
  • A taken page port: the next free one (8086…), shown in the WEB row, logged, and given to the tunnel as its web port (camex 4.1.2 lets connections through to that port only).

Version 1.48.0 (MINOR), CHANGELOG, README in three languages, new screenshots of the web page and the main screen.

Tests (local, in Docker)

  • tests/run.sh: all passed; websim covers the upload (names, a path, the same name, no file, busy) and the write of a dump (no upload, 404 for a missing or path name, 400 without the chip confirmed), and the page.
  • gradle assembleDebug lintDebug assembleRelease: OK; ownsListener kept in the release dex.
  • tests/android/remote-e2e.sh: API 34 and API 21, 11 passed each.
  • By hand on the emulator: 8085 taken by another listener → the page on 8086, the tunnel to 8086 answers, 8085 through the tunnel is reset.

🤖 Generated with Claude Code

… window (1.48.0)

The interface review of brass 1.3.0 (brand), in the app and on the web page.

Web page: the name with the version number, 'SPI NOR and NAND programmer'; a board of
rows with a lamp each (ADAPTER, CHIP, STATE, DUMP, CAMEX) in place of the lamps and the
display; eight buttons four a row with Export... (the dump shown) and Import... (a file to
the dump folder as import-NAME.bin, not written). Write writes the dump shown.
Web mode: POST /api/upload; POST /api/write with X-MicroSNANDer-File writes a dump
already in the dump folder, no upload.

Android app: the name with the version, the subtitle in plain type; the board (ADAPTER,
CHIP, STATE, WEB with its address and a lock, CAMEX); nine buttons three a row with
Export... (Save to a file, Share to an app), Import... and Settings; the Remote access
panel is gone. One brass SETTINGS window: the app's section and CAMEX from the tunnel
library, no link field. Start on boot and Show log with the log of events. A taken page
port (8085) gives the next free one, shown, logged, and passed to the tunnel.

Tests: tests/run.sh (websim: import, write of a dump, the page), gradle assembleDebug
lintDebug assembleRelease, tests/android/remote-e2e.sh on API 34 and 21 (11 passed each);
the port fallback and the tunnel to 8086 checked by hand on the emulator.

Co-Authored-By: Claude <noreply@anthropic.com>
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Unify brass interfaces and add dump Import and Export

✨ Enhancement 🐞 Bug fix 📝 Documentation 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Replace Android and web status displays with lamp-row boards and reorganized controls.
Merge Risk 🟡 Medium

Blast radius 🔴 High 💥 4 capabilities

  • 4 affected capabilities span independent functional scopes: Android remote-access integration, flash-image workflow.
  • The web upload endpoint, Android import flow, persistent dump directory, displayed dump, export, hex view, and Write selection are one bounded flash-image workflow.
  • They are producer, storage, and consumer hops of the same end-to-end behavior rather than independent technical capabilities.
  • Writing the displayed/imported dump is the programming outcome of the same bounded flash-image workflow.
  • The API, Android screen, dump file, and chip writer are propagation hops of one user-visible programming behavior, not separate scopes.
  • The service bind, WEB status row, settings, boot receiver, and browser-facing page are one bounded remote-access integration.
  • The port is an implementation resource within that behavior, not an independent capability.
  • Camex forwarding is a distinct system outcome from direct LAN web access, but it is part of the same bounded Android remote-access integration: settings select the tunnel, the service supplies the runtime web port, and the remote operator reaches the same programmer page.
Behavioral complexity 🔴 High 🧩 Multiple interactions

  • Before, the service used the configured port directly and started the tunnel against that fixed port.
  • After, it probes a range, publishes Settings.webPort, starts the tunnel after port selection, handles native bind failure, retries, and resets state on stop.
  • The new correctness condition is that the port displayed to the user, the native listener, the camex WEB_PORT, and the tunnel's actual destination remain consistent across asynchronous service, main-thread, and worker events.
  • The probe/release/bind sequence also introduces a real ordering window; this is newly interacting behavior, not merely routine socket use.
Potential damage 🟡 Medium 🩹 Recoverable

  • The direct dump-management consequence is loss of or incorrect display of the selected dump, or an import that must be repeated.
  • Reverting code does not remove already-created import files; supported recovery is to retry with the intended source file or delete/replace the imported dump.
  • No external effect occurs until the user invokes Write.
  • Usually recoverable by re-importing or deleting the persistent dump.
  • A code rollback alone does not repair already stored files, but the import path's cleanup prevents most interrupted copies from being adopted.
Assessed commit 96012f5
Diagram

graph TD
  AndroidUI["Android UI"] --> SettingsDialog["Settings dialog"] --> RemoteService["Remote service"] --> WebAPI["Web API"] --> Dumps[("Dump folder")]
  WebUI["Web page"] --> WebAPI
  AndroidUI --> Dumps
  RemoteService --> Camex["Camex tunnel"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Retry ports at the native bind
  • ➕ Avoids the gap between checking a free port and the web server binding it.
  • ➖ Requires changing the native listener interface and coordinating its selected port with Android and Camex.

Recommendation: The shared dump-folder workflow and unified settings dialog fit the existing architecture. The Java port probe is a pragmatic change, but a native bind-and-retry mechanism would be more robust if port contention is common.

Files changed (23) +1566 / -479

Enhancement (15) +1265 / -365
AppLog.javaAdd an in-process event log +54/-0

Add an in-process event log

• Keeps up to 200 timestamped events and notifies the visible screen when new events arrive.

android/app/src/main/java/org/openipc/microsnander/AppLog.java

BootReceiver.javaRespect the Start on boot preference +2/-2

Respect the Start on boot preference

• Starts remote access after boot only when remote access and the new boot preference are enabled.

android/app/src/main/java/org/openipc/microsnander/BootReceiver.java

Brass.javaProvide reusable brass UI components +163/-0

Provide reusable brass UI components

• Adds lamp-board rows and helpers for styled dialog panels, sections, titles, and buttons.

android/app/src/main/java/org/openipc/microsnander/Brass.java

MainActivity.javaRework the Android console and dump actions +285/-117

Rework the Android console and dump actions

• Replaces the status display and remote panel with board rows, adds Import and an Export menu, and makes Write use the shown dump when available. Connects unified settings, boot and log controls, and remote status to the screen.

android/app/src/main/java/org/openipc/microsnander/MainActivity.java

Settings.javaPersist display and boot choices +35/-2

Persist display and boot choices

• Adds Start on boot and Show log preferences, tracks the active web port, and supplies that port to Camex. Preserves prior boot behavior for existing installations with remote access enabled.

android/app/src/main/java/org/openipc/microsnander/Settings.java

SettingsDialog.javaCombine remote and Camex settings +199/-0

Combine remote and Camex settings

• Adds one brass dialog for web access and tunnel configuration, including validation and fields supplied by the Camex library. A Camex link opened with the app pre-fills its fields.

android/app/src/main/java/org/openipc/microsnander/SettingsDialog.java

focus_ring.xmlStyle D-pad selection focus +23/-0

Style D-pad selection focus

• Adds an amber focus outline for checkboxes and radio buttons on brass screens.

android/app/src/main/res/drawable/focus_ring.xml

lock_closed.xmlAdd password-protected WEB icon +12/-0

Add password-protected WEB icon

• Adds the closed-lock vector shown when the remote web page has a password.

android/app/src/main/res/drawable/lock_closed.xml

lock_open.xmlAdd unprotected WEB icon +12/-0

Add unprotected WEB icon

• Adds the open-lock vector shown when the remote web page has no password.

android/app/src/main/res/drawable/lock_open.xml

activity_main.xmlLay out the revised Android console +130/-150

Lay out the revised Android console

• Introduces the board container, nine-button grid, boot and log controls, and optional event log. Removes the separate remote-access panel.

android/app/src/main/res/layout/activity_main.xml

colors.xmlAdd success-state green +1/-0

Add success-state green

• Defines the green used by successful lamp-board states.

android/app/src/main/res/values/colors.xml

strings.xmlSupply labels for the revised interface +43/-22

Supply labels for the revised interface

• Adds board, dump-action, settings, and remote-status text while replacing obsolete display and panel labels.

android/app/src/main/res/values/strings.xml

themes.xmlStyle compact buttons and focused controls +17/-0

Style compact buttons and focused controls

• Adds a smaller button style for three-column rows and applies brass focus styling to checkboxes and radio buttons.

android/app/src/main/res/values/themes.xml

web.cAdd persistent dump upload and existing-dump write +202/-25

Add persistent dump upload and existing-dump write

• Adds POST /api/upload with sanitized, collision-resistant dump names and operation locking. Extends POST /api/write to accept a named regular dump file without uploading it again.

src/web.c

web_page.htmlRebuild the web console around status rows +87/-47

Rebuild the web console around status rows

• Replaces the lamps and display with a responsive board and eight-button layout. Adds Export and Import controls and makes Write target the displayed dump when one exists.

src/web_page.html

Bug fix (1) +89 / -18
RemoteService.javaSelect and report an available web port +89/-18

Select and report an available web port

• Tries the configured port and up to 15 successors, exposes listening state for the WEB row, and passes the selected port to Camex. Logs web and tunnel events.

android/app/src/main/java/org/openipc/microsnander/RemoteService.java

Documentation (4) +155 / -90
CHANGELOG.mdDocument the 1.48.0 interface release +26/-0

Document the 1.48.0 interface release

• Adds release notes for the revised interfaces, dump workflow, combined settings, and Android port fallback.

CHANGELOG.md

README.mdExplain the new web and Android workflows +48/-33

Explain the new web and Android workflows

• Documents the status boards, Import and Export behavior, unified settings, boot control, and selected web port. Refreshes screenshot descriptions.

README.md

README.ru.mdUpdate Russian interface documentation +50/-35

Update Russian interface documentation

• Describes the revised boards, dump actions, settings, and remote-access behavior in Russian.

README.ru.md

README.zh-CN.mdUpdate Chinese interface documentation +31/-22

Update Chinese interface documentation

• Describes the revised boards, dump actions, settings, and remote-access behavior in Chinese.

README.zh-CN.md

Other (3) +57 / -6
main.cSet the release version to 1.48.0 +1/-1

Set the release version to 1.48.0

• Changes the version reported by the program to 1.48.0.

src/main.c

remote-e2e.shMatch the revised page title in remote E2E +1/-1

Match the revised page title in remote E2E

• Updates the tunneled page assertion for the new HTML title.

tests/android/remote-e2e.sh

websim.cCover dump imports and writes in the web simulator +55/-4

Cover dump imports and writes in the web simulator

• Tests imported-file naming, path sanitization, busy and empty requests, downloads, and writing an existing dump with chip confirmation. Updates interface assertions for the new page.

tests/websim.c

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Open web access can fill dump storage ✓ Resolved
Description
upload_import retains every successful upload under a unique name, while the server accepts
requests without authentication when no web password is configured. On a network-facing listener,
any reachable client can repeatedly upload files of up to 512 MiB each; the one-at-a-time lock and
per-file limit do not bound the storage retained.

2. Some imported files cannot be linked or written from the web page ✓ Resolved
Description
MainActivity.importName replaces .. only once, leaving an overlapping .. in picked filenames
such as a...b.bin, which becomes import-a_..b.bin. importUri publishes that name and isDump
accepts it, but src/web.c rejects it, so the remote page’s DUMP link, hex view and bodyless Write
return 404.


Informational

3. Save to a file can save a different dump than the one named ✓ Resolved
Description
exportMenu captures dump = lastDump() and shows its name, and saveTo(dump) passes that name to
the system picker. When the picker returns, saveAs calls lastDump() again and copies whatever
file is newest at that moment. If the remote page runs a Read or an Import while the picker is open,
the newer dump's contents are written under the first dump's name.

4. A remote Write can flash a half-copied import ✓ Resolved
Description
importUri sets only the activity's busy flag and copies straight into the final
import-NAME.bin in the shared dumps folder. It never takes the native operation slot
(web_local_begin). While the copy runs, a remote POST /api/write with X-MicroSNANDer-File
naming that predictable file passes dump_open's checks (regular, non-empty, valid name) and writes
the partial image to the chip.

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

…Save saves the dump named, Import never shows a half copy

- web.c: an upload keeps the three newest imports and drops the older ones, so an open page
  cannot fill the disk however many uploads come (websim: four imports, three kept).
- MainActivity.importName: '..' replaced until none is left (a...b.bin gave a name web.c
  refuses); isDump refuses '..' and '/' as dump_ok does.
- Save to a file saves the dump the menu named, not whatever is the newest when the picker
  returns.
- Import copies under .import-copy (a name no page takes) and renames it after the copy, so a
  remote Write never takes a half-copied file; the app keeps the three newest imports too.

Co-Authored-By: Claude <noreply@anthropic.com>
@compot-dev

Copy link
Copy Markdown
Collaborator Author

Qodo review of bf49718: all four fixed in a7e44b2.

  1. Open web access can fill dump storage — an upload now keeps the three newest imports and removes the older ones (imports_prune in src/web.c), so the space an open page can take is bounded; websim checks four imports leave three. The app keeps three imports the same way.
  2. Imported names with .. — importName replaces .. until none is left (a...b.bin → import-a__.b.bin), and isDump refuses .. and / as dump_ok does.
  3. Save to a file can save another dump — the name chosen in the Export menu is kept and saveAs saves that file; if it is gone, it says it cannot save.
  4. A remote Write of a half-copied import — Import copies under .import-copy (a name dump_ok refuses) and renames it to its import-NAME.bin only after the copy succeeded.

Local: tests/run.sh all passed, gradle assembleDebug lintDebug assembleRelease OK.

Co-Authored-By: Claude <noreply@anthropic.com>
@compot-dev
compot-dev merged commit cb04d5e into main Nov 18, 2026
9 checks passed
@compot-dev
compot-dev deleted the interface-review branch November 18, 2026 23:57
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