Skip to content

ADFA-5236 fix(connect/clone): always show the manual access (no reveal toggle) - #464

Merged
luisguzman-adfa merged 12 commits into
mainfrom
fix/ADFA-5236-manual-address-always-visible
Aug 25, 2026
Merged

luisguzman-adfa merged 12 commits into
mainfrom
fix/ADFA-5236-manual-address-always-visible

Conversation

@luisguzman-adfa

@luisguzman-adfa luisguzman-adfa commented Aug 21, 2026 •

Copy link
Copy Markdown
Collaborator

ADFA-5236 — Connect/Clone: always show the manual access (no reveal toggle)

Many phones have no QR scanner and offline users can't fetch one, so the manual access — hotspot Wi-Fi + password, or the library URL — must be readable without a tap. This PR makes that block always visible, cleans up its presentation, and then improves QR scannability for weak cameras.

Manual access, always visible. QrSection now shows the fallback block ALWAYS — the "Scan didn't work?/Hide" reveal toggle and its fbOpen/applyFallbackOpen logic are gone. Values render as rounded key:value chips: a muted label over a monospaced value (split on the first ": "), or a lone monospaced value for the URL. Monospace keeps digits vs letters unambiguous (0/O, 1/l). Each chip carries an icon-only Copy in a reserved trailing slot (icon-only so a long URL/IP keeps its width via autosize) and the whole chip is tappable; Share is not here. Captions carry the intent ("… or use the following credentials instead:" / "Scan to open the library or visit this website:"), the Wi-Fi "same Wi-Fi" subcaption is dropped, and the fallback block's duplicate background is removed on both screens.

QR scannability. Design asked for more white space around the QR; we went with the levers that actually help weak cameras on low-end phones. The code is already optimal on the standard (black-on-white regardless of theme, ISO/IEC 18004 four-module quiet zone, ECC level L = largest modules), and extra white beyond the quiet zone gives no decode benefit — inside a fixed card it only shrinks the code and glares in dark mode — so that request was declined, with reason. Instead: (1) QR size scales with the screen via @dimen/k2go_qr_size, bucketed by smallest-width — 252dp default → 288 (sw360) → 308 (sw400) → 320 cap (sw600); sw = shortest side, so it also bounds landscape/tablets; applies to all five QR surfaces. (2) The bitmap is encoded at that rendered size (one source of truth), so it stays sharp per bucket instead of upscaling a fixed bitmap and softening the modules.

Out of scope, recorded. Shortening the Clone payload (denser QR — separate chore, touches the handshake); a border/affordance card (only ever outside the quiet zone — declined: risk without decode gain); physical aids (screen brightness while a QR is shown, keeping the chat FAB off the code).

Localization. Strings updated across all locales — EN and ES by hand, the rest machine-translated and flagged for native review (bn, gu, ta, sw, az, yo, sr).

… reveal toggle

Many phones have no QR scanner and offline users can't fetch one, so the hotspot
Wi-Fi + password and the library URL must be visible without a tap. QrSection now
shows the fallback block ALWAYS (removed the "Scan didn't work?/Hide" toggle,
fbOpen, applyFallbackOpen) and monospaces the values so digits vs letters can't be
misread (0/O, 1/l). Captions carry the intent ("... or use the following
credentials instead:" / "Scan to open the library or visit this website:"), the
Wi-Fi "same Wi-Fi" subcaption is dropped, and the "Available while the app is
open." Connect footer is hidden. Strings updated in EN + ES (other locales later).
…autosize)

The always-shown value wrapped at TitleLarge when the URL/IP was long
(http://192.168.1.159:8085 -> two lines). Autosize each value uniformly (12-22sp,
maxLines 1) with match_parent width, so a long URL shrinks to fit the card on one
line while short values keep the full size.
Per the proposed mockup: each fallback value sits in its own rounded
surface-container "field" chip. Credential strings ("Wi-Fi: x" / "Password: y")
split on the first ": " into a muted label + a mono value; a URL (no ": ")
renders as a lone mono value. Values keep the one-line autosize (12-22sp). Chip
fill from colorSurfaceContainerHighest (M3, day/night), label k2go_muted, value
k2go_ink. No new strings, no caller/signature change.
…ouble bg)

Now that each value is its own chip, the sec_fallback container's k2go_card_bg +
padding sat behind the chips as a second background. Make the container a
transparent stacker (no bg, no padding) so only the chip shows.
…double bg)

The previous fix only touched the shared view_k2go_qr_section (used by Clone).
Connect has its own containers in fragment_k2go_connect.xml (k2go_conn_fallback1/2/S)
which still carried k2go_card_bg + padding behind the per-value chip. Removed it on
all three so only the chip shows.
Per the v1 spec: Copy in a reserved TRAILING slot (never floating over the value)
-- icon-only for the short Wi-Fi/password chips, word+icon "Copy" for the long
URL/IP; the whole chip is also tappable to copy. Copies the FULL value and
confirms with a "Copied" snackbar (SnackbarDuration.millisForText). No Share on
chips (that stays on the Clone payload only). Adds ic_content_copy (tinted teal)
and k2go_copied (EN + ES; English placeholder in the other 32 locales pending a
translation pass).
…toggle)

The Send code payload no longer hides behind "Show the code as text ▸ / Hide";
it shows always under a fixed label "Show the code as text:", with Copy + Share
kept at the bottom of the block (Share belongs only on the payload). Repurposes
showcode as a static muted label, drops codeExpanded. String updated EN + ES.
… for the IP)

The word+icon "Copy" on the URL chip stole width and capped the IP autosize.
Drop it; the URL uses the same trailing icon-only Copy as the Wi-Fi/password
chips, so a long http://<ip>:8085 keeps the full one-line size. Removed the now
unused copyWordButton.
…/ADFA-5236-manual-address-always-visible

ADFA-5236 chore(i18n): resolve strings_k2go merge (union) + retranslate reworded strings

Merge main into fix/ADFA-5236-manual-address-always-visible. All 34
strings_k2go.xml conflicted — both sides appended new <string>s at the end
of <resources>; resolved as union (keep ADFA-5236 k2go_copied and main's
k2go_eta_*).

Translation repair (ADFA-5236): the 5 reworded strings + k2go_copied were
stale/English across 32 locales; retranslated to the new English. es kept
(human), sr fixed to Cyrillic. Machine translations pending native-speaker
review for bn, gu, ta, sw, az, yo, sr.
…r scanning

QR frames 220dp -> 242dp across Connect (join/open/Wi-Fi) and Clone.
Already ISO/IEC 18004-compliant (4-module quiet zone, ECC level L =
largest modules), so the code was optimal; the +10% just gives weaker
guest cameras a bit more to read. Quiet zone and ECC untouched; both
screens are in a ScrollView and the bitmap encodes at view size, so no
layout break and no pixelation.
…easier scanning

QR size moves from a fixed 220dp to @dimen/k2go_qr_size, bucketed by
smallest-width: 250dp default (small/old phones) -> 288dp (sw360) ->
308dp (sw400) -> 320dp cap (sw600, tablets). Bigger modules help weak
guest cameras; sw = shortest side, so it also bounds landscape/tablets.
ISO/IEC 18004 quiet zone + ECC L are baked into the bitmap and scale
with it, so decoding/contrast are unchanged.
The QR bitmap was encoded at a fixed size (200dp in QrSection, 500px in
CloneFragment) while the frame scales via @dimen/k2go_qr_size, so larger
buckets upscaled a small bitmap and softened the modules — the opposite
of the goal. Encode from the same dimen (getDimensionPixelSize) so size
and resolution share one source of truth and stay sharp per bucket. Also
nudge the default 250->252dp onto the 4dp grid.
@luisguzman-adfa
luisguzman-adfa merged commit c5a8904 into main Aug 25, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/ADFA-5236-manual-address-always-visible branch August 25, 2026 20:48
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