Skip to content

chore: improve trezor dashboard#939

Open
ovitrif wants to merge 19 commits into
masterfrom
feat/trezor-hardware-support-fixes
Open

chore: improve trezor dashboard#939
ovitrif wants to merge 19 commits into
masterfrom
feat/trezor-hardware-support-fixes

Conversation

@ovitrif
Copy link
Copy Markdown
Collaborator

@ovitrif ovitrif commented May 11, 2026

Description

This PR is intended to address review feedback without changing the Trezor dashboard behavior introduced by #792:

  1. Addresses the remaining actionable review feedback from feat: trezor hardware support #792.
  2. Propagates Trezor repository, reconnect, credential, and BLE failures instead of silently swallowing them.
  3. Splits and tightens Trezor UI state, including immutable UI collections and a composite connected-device state.
  4. Adds focused unit coverage for retry, reconnect, filtering, persistence, send guards, BLE close timeout reporting, and ViewModel flows.

This PR should be validated only against #792.

Preview

testing-3x.mp4

QA Notes

Base comparison:

Official emulator setup:

  1. Use the official Trezor User Env from https://github.com/trezor/trezor-user-env.
  2. Start it from ~/repos/github/trezor-user-env with ./run.sh --no-regtest.
  3. If the Apple Silicon container cannot load SDL3, install the missing runtime packages once with docker exec trezor-user-env.mac sh -lc 'apt-get update && apt-get install -y libsdl3-0 libsdl3-image0'.
  4. Start Bridge and a deterministic T2T1 emulator through the User Env controller:
python3 - <<'PY'
import asyncio, json, websockets

async def send(payload):
    async with websockets.connect('ws://localhost:9001') as ws:
        await ws.recv()
        await ws.send(json.dumps(payload))
        print(await ws.recv())

async def main():
    await send({'type': 'bridge-start', 'version': 'node-bridge', 'id': 1})
    await send({'type': 'emulator-start', 'model': 'T2T1', 'version': '2-main', 'wipe': True, 'id': 2})
    await send({
        'type': 'emulator-setup',
        'mnemonic': 'all all all all all all all all all all all all',
        'pin': '',
        'passphrase_protection': False,
        'label': 'Bitkit Test Trezor',
        'needs_backup': False,
        'id': 3,
    })
    await send({'type': 'background-check', 'id': 4})

asyncio.run(main())
PY

Physical phone install:

  • adb reverse tcp:21325 tcp:21325
  • TREZOR_BRIDGE=true TREZOR_BRIDGE_URL=http://127.0.0.1:21325 ./gradlew installDevDebug

Android emulator install:

  • TREZOR_BRIDGE=true TREZOR_BRIDGE_URL=http://10.0.2.2:21325 ./gradlew installDevDebug

Validation done:

  • Official Trezor User Env cloned at ~/repos/github/trezor-user-env and started with ./run.sh --no-regtest.
  • Host Python websockets installed for controller commands.
  • User Env controller ping passed.
  • bridge-start with node-bridge passed.
  • T2T1 2-main emulator starts after installing libsdl3-0 and libsdl3-image0 in the container.
  • emulator-setup passed with the deterministic all all ... seed and label Bitkit Test Trezor.
  • curl -X POST http://localhost:21325/enumerate returns the official Bridge device: path=1, id=127.0.0.1:21324, apiType=usb.
  • adb reverse tcp:21325 tcp:21325 passed on the Pixel 10 Pro test phone.
  • Bridge-enabled dev APK built and installed on the Pixel 10 Pro.
  • ./gradlew compileDevDebugKotlin testDevDebugUnitTest detekt --rerun-tasks.

Regression checklist against #792:

PR can be approved after code review and light smoke testing, without the need for extensive testing.

The dev validation approach, as described above, involved retesting same functionalities tested in #792 then comparing the results for equality in user-facing functional behavior.

Comment thread app/src/main/java/to/bitkit/repositories/TrezorRepo.kt Outdated
Comment thread app/src/main/java/to/bitkit/repositories/TrezorRepo.kt Outdated
@ovitrif ovitrif self-assigned this May 11, 2026
@ovitrif ovitrif modified the milestones: 2.3.0, 2.4.0 May 11, 2026
@ovitrif ovitrif mentioned this pull request May 11, 2026
7 tasks
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1750d15a1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/main/java/to/bitkit/ui/screens/trezor/TrezorViewModel.kt
Comment thread app/src/main/java/to/bitkit/ui/screens/trezor/TrezorViewModel.kt Outdated
@ovitrif ovitrif changed the title fix: address trezor review comments fix: improve trezor dashboard May 17, 2026
@ovitrif ovitrif changed the title fix: improve trezor dashboard chore: improve trezor dashboard May 17, 2026
@ovitrif ovitrif force-pushed the feat/trezor-hardware-support-fixes branch from 082436c to b49e879 Compare May 17, 2026 18:21
@ovitrif ovitrif force-pushed the feat/trezor-hardware-support branch from 42b92f7 to 280c4e7 Compare May 17, 2026 19:36
@ovitrif ovitrif force-pushed the feat/trezor-hardware-support-fixes branch 2 times, most recently from f71883d to c224341 Compare May 17, 2026 23:08
Base automatically changed from feat/trezor-hardware-support to master May 18, 2026 00:24
@ovitrif ovitrif force-pushed the feat/trezor-hardware-support-fixes branch from c224341 to 1ecae3d Compare May 18, 2026 00:29
@ovitrif ovitrif modified the milestones: 2.4.0, 2.3.0 May 18, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ecae3dcbc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/main/java/to/bitkit/ui/screens/trezor/TrezorViewModel.kt Outdated
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.

2 participants