Skip to content

feat: add vertical input for Stackbit 1248#862

Open
bitcoisas wants to merge 3 commits into
selfcustody:developfrom
bitcoisas:feat/stackbit-1248-vertical-input
Open

feat: add vertical input for Stackbit 1248#862
bitcoisas wants to merge 3 commits into
selfcustody:developfrom
bitcoisas:feat/stackbit-1248-vertical-input

Conversation

@bitcoisas

@bitcoisas bitcoisas commented May 18, 2026

Copy link
Copy Markdown

What is this PR for?

This PR adds vertical layout support for Stackbit 1248 seed input, covering the input/loading side of #834.

A "Vertical" option is added to the "Load from 1248" submenu alongside the existing "Standard" layout. Also, this PR complement this other one: #847 (backup side).

Closes input part of #834

Changes made to:

  • Code
  • Tests
  • Docs
  • CHANGELOG

Did you build the code and tested on device?

e651e85a-b86d-4dfe-9299-7390d7948825

What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Docs update
  • Other

Screenshots:

load-mnemonic-via-stackbit-vertical-filled-250 en image

@bitcoisas bitcoisas changed the base branch from main to develop May 18, 2026 23:15
@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.36%. Comparing base (9ef5803) to head (e9509e4).
⚠️ Report is 14 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #862      +/-   ##
===========================================
+ Coverage    97.30%   97.36%   +0.05%     
===========================================
  Files           83       83              
  Lines        10798    10986     +188     
===========================================
+ Hits         10507    10696     +189     
+ Misses         291      290       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bitcoisas bitcoisas force-pushed the feat/stackbit-1248-vertical-input branch 3 times, most recently from 73e2c55 to ab698b7 Compare May 18, 2026 23:50
@bitcoisas bitcoisas marked this pull request as ready for review May 19, 2026 01:28
@bitcoisas

Copy link
Copy Markdown
Author

Should these changes be added to the changelog? If so, for the May release?

@qlrd

qlrd commented May 19, 2026

Copy link
Copy Markdown
Member

Should these changes be added to the changelog? If so, for the May release?

For now make it drat and make changes on CHANGELOG.md

@odudex

odudex commented May 19, 2026

Copy link
Copy Markdown
Member

As the form factor allows, try to increase grid size and better use screen surface, making it easier to type.

@bitcoisas bitcoisas marked this pull request as draft May 19, 2026 14:01

@qlrd qlrd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

some nits to DRY:

Comment thread tests/pages/test_stackbit.py Outdated
Comment thread tests/pages/test_stackbit.py Outdated
Comment thread tests/pages/test_stackbit.py Outdated
Comment thread src/krux/pages/mnemonic_loader.py
Comment thread src/krux/pages/mnemonic_loader.py Outdated
@bitcoisas bitcoisas force-pushed the feat/stackbit-1248-vertical-input branch 2 times, most recently from 1e11ac2 to 70f6ffb Compare May 19, 2026 17:52
@bitcoisas

Copy link
Copy Markdown
Author

@qlrd Implemented the DRY refactor suggestion and removed the layout size limiter for larger devices @odudex, now making full use of the available screen. Updated docs and screenshots accordingly.

Still need to test on device, i will update here later today! :)

@bitcoisas bitcoisas marked this pull request as ready for review May 19, 2026 18:07
@bitcoisas

Copy link
Copy Markdown
Author

Still need to test on device, i will update here later today! :)

Done, updated the PR Device image tho!

@bitcoisas bitcoisas requested a review from qlrd May 20, 2026 16:06

@qlrd qlrd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but if possible, i would check the uncovered lines. Saw them and found weird that they aren't covered. Either untested by some case or those pieces receive more love.

@joaozinhom joaozinhom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, there are some uncovered lines to review but i think its a simple mock test work, in my view the uncovered lines are in the following functions:
_toggle_bit_vertical;
_index_vertical;

@qlrd

qlrd commented May 21, 2026

Copy link
Copy Markdown
Member

LGTM, there are some uncovered lines to review but i think its a simple mock test work, in my view the uncovered lines are in the following functions: _toggle_bit_vertical; _index_vertical;

One thing that i learned here is that we have potential dead codes, @bitcoisas check if they're dead codes or just need mock like @joaozinhom says

@bitcoisas

Copy link
Copy Markdown
Author

_toggle_bit_vertical;
_index_vertical;

i will work on the coverage later today, checking if we have dead code and also writing some new unit tests too! Thanks again team learning a lot with your guidance! :)

@bitcoisas bitcoisas force-pushed the feat/stackbit-1248-vertical-input branch 3 times, most recently from e6c5070 to 22e2533 Compare May 22, 2026 02:21
@bitcoisas bitcoisas requested review from joaozinhom and qlrd May 22, 2026 02:27
@bitcoisas

Copy link
Copy Markdown
Author

LGTM, there are some uncovered lines to review but i think its a simple mock test work, in my view the uncovered lines are in the following functions: _toggle_bit_vertical; _index_vertical;

One thing that i learned here is that we have potential dead codes, @bitcoisas check if they're dead codes or just need mock like @joaozinhom says

Good catch @qlrd and @joaozinhom ! The if digits[col] == 0 branch in both clamps is unreachable since those cases are already blocked by VERT_INVALID_CELLS, so I simplified both to new_val = 0.

Added unit tests for the remaining paths: early return for invalid cells and forward navigation in _index_vertical.

Now we have the 100% coverage and a cleaner code. Thank you again for the reviews.

@joaozinhom joaozinhom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK 22e2533

@qlrd

qlrd commented May 23, 2026

Copy link
Copy Markdown
Member

Two last commits could go as one

@bitcoisas bitcoisas force-pushed the feat/stackbit-1248-vertical-input branch from 22e2533 to 459abe5 Compare May 24, 2026 00:39
@bitcoisas bitcoisas force-pushed the feat/stackbit-1248-vertical-input branch from 477bd0e to cffc8af Compare May 26, 2026 00:07
@bitcoisas bitcoisas requested a review from qlrd May 26, 2026 19:16
Comment thread src/krux/pages/stack_1248.py Outdated
Comment thread src/krux/pages/stack_1248.py Outdated
Comment thread tests/pages/test_login.py
Comment thread tests/pages/test_stackbit.py Outdated
Comment thread tests/pages/test_stackbit.py Outdated
Comment thread tests/pages/test_stackbit.py Outdated
Comment thread CHANGELOG.md Outdated
Comment thread docs/getting-started/usage/loading-a-mnemonic.en.md Outdated
@bitcoisas

Copy link
Copy Markdown
Author

Just a FUP, i'm working on the updates that you suggested/asked to change here @qlrd. And thank you very much to make me level up every day! :)

@bitcoisas bitcoisas force-pushed the feat/stackbit-1248-vertical-input branch 4 times, most recently from 70b6152 to 5bb237a Compare June 2, 2026 01:39
Comment thread src/krux/pages/stack_1248.py Outdated
@bitcoisas bitcoisas force-pushed the feat/stackbit-1248-vertical-input branch 4 times, most recently from 93d30ee to 6cafc38 Compare June 9, 2026 01:33
Co-authored-by: qlrd <106913782+qlrd@users.noreply.github.com>
@bitcoisas bitcoisas force-pushed the feat/stackbit-1248-vertical-input branch from 6cafc38 to a68ff88 Compare June 9, 2026 01:46
@bitcoisas

Copy link
Copy Markdown
Author

hey @qlrd merged your PR, thanks for the refactor learned a lot with your test style, but i kept the guard in _toggle_bit_vertical bc its reachable via touch even tho the cells are shaded, added a test to cover it.

@bitcoisas bitcoisas requested review from joaozinhom and qlrd June 9, 2026 01:53

@joaozinhom joaozinhom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK a68ff88

@jdlcdl

jdlcdl commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

ACK tested at a68ff88 on simulator, amigo and yahboom_devkit (also had a chance to see merged pr_834 in action).

The task of stackbit1248 data entry was easier than I imagined, and is easier than tinyseed-ish data entry, especially with fat fingers and smaller yahboom_devkit screen. Still I made errors along the way and had a chance to say No or to fix before confirmation... or to correct the word once I realized my 12 checksum word was wrong... flow felt nice the entire time.

regarding Tadeu's comment in pr 834 with the unlabeled plate... this seems like an interesting backup method if user is shooting for "I don't want anyone to know what this plate represents in the event they find it.":

unlabeled stackbit1248 plate
It would be a very low-tech solution to:

  • start with a transparent template (plastified vellum) of stackbit1248,
  • cover the template with a fat strip of scotch-tape,
  • mark-up the scotch-tape with permanent marker until it is a verified stackbit1248 backup,
  • peel-off the scotch-tape and lay it over any piece of scrap inox/stainless,
  • punch and mark corners to cut-to-shape.

...to recover, lay your stackbit1248 transparent template over your unlabeled backup plate and load into krux.

@jdlcdl

jdlcdl commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Very neat improvements @bitcoisas, still to address: requested changes from @qlrd ?!?!

@bitcoisas

Copy link
Copy Markdown
Author

Very neat improvements @bitcoisas, still to address: requested changes from @qlrd ?!?!

Thanks for the ACK and for testing on multiple devices, @jdlcdl. I believe I ve addressed all of @qlrd requested changes and already requested a re-review.

@qlrd qlrd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just som non-blocking nits and a suggestion to replace test docstrings to comments

Comment thread docs/getting-started/usage/loading-a-mnemonic.en.md Outdated
Comment thread docs/getting-started/usage/loading-a-mnemonic.en.md Outdated
@bitcoisas bitcoisas force-pushed the feat/stackbit-1248-vertical-input branch from a68ff88 to e9509e4 Compare June 10, 2026 23:40
@bitcoisas bitcoisas requested a review from qlrd June 10, 2026 23:48

@qlrd qlrd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK e9509e4

@odudex

odudex commented Jun 12, 2026

Copy link
Copy Markdown
Member

One thing that we should discuss with @stackbitme is the use of "Stackbit" brand. This format was not created or used by Stackbit. AFAIK there's only one guy making it (the mead guy), maybe we could differentiate the original one as Stackbit 1248, and this new one as "Vertical 1248".
What do you think about this @stackbitme?

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.

5 participants