Skip to content

Fix/android UI msdp and polish - #8

Merged
HarryCordewener merged 4 commits into
masterfrom
fix/android-ui-msdp-and-polish
Jun 30, 2026
Merged

Fix/android UI msdp and polish#8
HarryCordewener merged 4 commits into
masterfrom
fix/android-ui-msdp-and-polish

Conversation

@HarryCordewener

Copy link
Copy Markdown
Member

No description provided.

HarryCordewener and others added 4 commits June 30, 2026 17:24
…board) + B-polish

Device-reported fixes
- Scrollback race crash: Session.Scrollback handed out the live List<ScrollbackLine>
  which the telnet read thread mutated mid-enumeration on the Blazor render thread
  ("Collection was modified" -> dead UI). The getter now returns an immutable ToArray()
  snapshot under a lock guarding both append sites. Regression test:
  ScrollbackConcurrencyTests (bounded/deterministic).
- MSDP native crash: the server's MSDP negotiation crashed Mono with a SIGSEGV because
  TelnetNegotiationCore < 2.5.1 shipped the F# MSDPLibrary but never declared FSharp.Core,
  so it was missing from the APK. Bumped TNC to 2.5.1 (which now declares it); FSharp.Core
  now flows in transitively and is packaged.
- Status-bar inset + soft keyboard: pure CSS env()/visualViewport can't work on the
  device's Android System WebView 133 (needs WebView >= 136/139/144). Added a native
  WindowInsets -> CSS-variable bridge (Platforms/Android/WebViewInsetsBridge.cs, wired from
  MainPage on BlazorWebViewInitialized) that pushes --sc-safe-* and --sc-keyboard-height;
  MainActivity sets adjustResize; app.css consumes them (max(env, var) padding,
  height minus keyboard).

B-polish
- Protocol-toggle button got a real <> SVG icon (was literal "{ }"); session header
  styled with a connection state-pill; ProtocolPanel fully styled (was 0 CSS).
- History-search UI: HistorySearchViewModel + HistorySearchView + /history page + 4th
  bottom-nav entry, wired to the existing FTS5 ISessionHistory.SearchAsync, character
  names resolved via IWorldStore; registered in both hosts.
- Web preferences are now file-backed (App_Data/preferences.json) so they survive reload;
  WebSecretStore documented as deliberately in-memory (no plaintext creds on disk).

All test suites pass (184 TUnit + 46 bUnit + 17 Data); Android head and Web host build
0-warning. On-device inset/keyboard behavior needs verification after install.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HHCRc5CJ6595iMzEgYYdQp
…tions break it

The Release Android build's trimmer ("optimize assemblies for size") aborts with
IL2040 / NETSDK1144 on FSharp.Core's embedded ILLink.Substitutions.xml: it tries
to remove F# signature/optimization embedded resources it can't find. FSharp.Core
now enters the closure via TelnetNegotiationCore's F# MSDP assembly (needed to fix
the MSDP runtime crash), and the substitution step can't be suppressed or skipped
(rooting the assembly does not bypass it). Set PublishTrimmed=false for the Android
Release config (AOT was already disabled). The APK is larger but builds; trimming
can return if FSharp.Core's linker metadata is fixed upstream.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HHCRc5CJ6595iMzEgYYdQp
The column math hard-coded a 0.6em monospace advance to pick the font and compute
NAWS. The real rendered advance is wider (~0.616), so an advertised MinColumns (78)
physically fit only ~76 and the server's 78-wide lines wrapped two columns short.

Port SharpMUSH.Client's terminalMetrics.js approach into sc-interop.js `measureGrid`:
- advance + line-height MEASURED from hidden probes (200-char run averages sub-pixel
  rounding; 5-line probe for line-height), copying the resolved --mono family,
  letter-spacing and font-feature-settings — never derived from font-size;
- fit the font so exactly MinColumns span the content width, with a closed-loop
  correction (re-measure MinColumns chars, shrink on overflow) for glyph-advance
  non-linearity from hinting;
- padding-aware content width (matches the ResizeObserver contentRect basis);
- report exactly MinColumns over NAWS and publish --out-fs/--sc-cols on the element.

OutputView's track now holds a `calc(var(--sc-cols) * 1ch)` min-width and the output
area scrolls horizontally, so on a screen too narrow to fit MinColumns at the minimum
font the lines scroll instead of wrapping — what the player sees matches the server's
wrap width. Removed the now-unused setFontSize interop.

Tests: 184 TUnit + 46 bUnit green; UI/Web build 0-warning.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HHCRc5CJ6595iMzEgYYdQp
@HarryCordewener
HarryCordewener merged commit 21c31e5 into master Jun 30, 2026
2 checks passed
@HarryCordewener
HarryCordewener deleted the fix/android-ui-msdp-and-polish branch June 30, 2026 23:46
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