Skip to content

Settings: Network drive — Samba sign-in details and simple connect guides - #43

Merged
ehsan6sha merged 3 commits into
mainfrom
feat/network-drive
Oct 4, 2026
Merged

ehsan6sha merged 3 commits into
mainfrom
feat/network-drive

Conversation

@ehsan6sha

Copy link
Copy Markdown
Member

Summary

A Network drive screen so a non-technical owner can use their Blox as a NAS. The firmware (fula-ota #98, go-fula #250) already turns on a login-only Samba share with a per-device password; the app now shows the sign-in details and walks the user through connecting.

  • Entry points: a Network drive card on the Blox dashboard and Settings → Network drive (/settings/network-drive).
  • Sign-in details (address, user name, password hidden until "Show") with Copy buttons, then 3–5 plain steps for Windows / Mac / iPhone & iPad / Android, preselected from the device. Mac gets an "Open in Finder" button.
  • Addresses: Windows \\NAME\SharedFolder (IP when there's more than one Blox); Mac / iPhone / Android smb://IP/SharedFolder. Never .local (the Blox has no mDNS).
  • "Can't connect?" tips, a safety note, and plain states: connecting, loading, not set up yet (404), update needed / owner only (401), busy, offline.
  • Privacy: the password lives only in the screen's React state — never persisted, logged or toasted; cleared on Blox switch / unmount; kept out of the DOM until shown.

Also fixed

  • fx-ui FxCopyButton never copied without an onCopied prop (onCopied?.(await copy(value)) short-circuits its argument). This affected every CopyRow (peer ids, wallet address), the DID copy in LinkPassword, and the Chrome-settings copy buttons.

Client

  • fula-web-client: blockchain.nasCredentials(bloxPeerId?) → go-fula nas-credentials; rejects with typed errors, never logs the body.

Tests

  • npm run typecheck, npm run lint, npm test (fula-web-client 65, fx-ui incl. new copy-button tests, app 1016 tests / 108 files), npm run build, Playwright e2e 88 passed (route loads clean on desktop + Android profiles).
  • New: screen tests (states, OS preselect, iPad detection, address rules, every error mapping, Blox switch race, password never in DOM before reveal / console / clipboard only on tap), helper tests, CopyRow secret, route + dashboard card.

Notes

  • Works with Blox firmware that includes fula-ota #98 + go-fula #250; older firmware shows "Update needed".
  • zh strings are machine-translated (OS control names use the real Windows/macOS/iOS wording) — please have a native speaker review.
  • The owner-signed success path is verified by unit tests; the first real end-to-end check needs the owner wallet against an updated Blox.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E9tV7663sXt1NFiCzM47wy

ehsan6sha and others added 3 commits October 4, 2026 16:57
FxCopyButton did `onPress={async () => onCopied?.(await copy(value))}`. An
optional call skips evaluating its arguments when the callee is undefined, so
every FxCopyButton without an `onCopied` prop never copied anything: CopyRow
(peer ids, wallet address), LinkPassword (DID), Requirements and LanErrorCard
(Chrome settings URL). Copy first, then report the result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E9tV7663sXt1NFiCzM47wy
`blockchain.nasCredentials(bloxPeerId?)` calls go-fula's `nas-credentials`
(go-fula #250) with `{blox_peer_id}` and returns the Blox's Samba sign-in
details. Unlike the react-native-fula ports it rejects (HTTP_ERROR with
.status 404 not set up / 400 / 503 / 500, NOT_AUTHORIZED, BAD_RESPONSE) and
never returns or logs a raw body, because the response holds a password.

Tests: wire name / body / statuses, and fake-Blox end-to-end cases for 200,
400 mismatch, 404, a garbage 200 body and an unauthorized identity, asserting
the password never reaches the debug log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E9tV7663sXt1NFiCzM47wy
…ides

The firmware (fula-ota #98) gives every Blox a login-only Samba share with a
per-device password; this screen lets a non-technical owner use it:

- /settings/network-drive, reachable from a new "Network drive" card on the
  Blox dashboard and from Settings (after Pools).
- Sign-in details (address, user name, password hidden until "Show") with Copy
  buttons, then 3-5 plain steps for Windows, Mac, iPhone/iPad and Android,
  preselected from the device (an iPad reporting a Mac user agent gets the
  iPhone/iPad guide). Mac also gets an "Open in Finder" smb:// button.
- Addresses: Windows uses \\NAME\SharedFolder (the IP when there is more than
  one Blox or the name is not NetBIOS-safe); Mac/iPhone/Android use
  smb://IP/SharedFolder from what the app already knows about the Blox's LAN
  address. Never `.local` (the Blox has no mDNS).
- "Can't connect?" tips per device, a one-line safety note, and plain states
  for connecting / loading / not set up yet / update needed / owner only /
  busy / offline.
- The password lives only in the screen's state: never persisted, logged or
  toasted, cleared on Blox switch and unmount. CopyRow gains a `secret` mode
  that keeps the value out of the DOM (incl. title / data-value) until shown.
- en + zh strings (zh machine-translated, OS control names in the real
  Windows/macOS/iOS wording — please have a native speaker review).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E9tV7663sXt1NFiCzM47wy
@ehsan6sha
ehsan6sha merged commit ca5b6f8 into main Oct 4, 2026
2 checks passed
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