Skip to content

Add Details/Summary components and improve code blocks#381

Merged
futurepaul merged 11 commits intosledtools:masterfrom
futurepaul:hypernote-details
Mar 3, 2026
Merged

Add Details/Summary components and improve code blocks#381
futurepaul merged 11 commits intosledtools:masterfrom
futurepaul:hypernote-details

Conversation

@futurepaul
Copy link
Collaborator

@futurepaul futurepaul commented Mar 2, 2026

Summary

This PR started as a Hypernote UI feature change and expanded into a full local UI E2E stabilization pass across iOS + Android.

It now includes:

  • Hypernote Details/Summary support on iOS and Android.
  • Code block UI improvements (language header + copy feedback).
  • iOS Swift wiring fixes that were broken after merge churn.
  • Rust local relay/bot harness fixes for deterministic UI E2E.
  • Android instrumentation test compile/runtime fixes.
  • Optional UI E2E video recording hooks (artifact-backed).

Hypernote Feature Work

Added components

  • Details + Summary rendering on iOS and Android.
  • Collapsible details behavior with summary tap target.
  • Code block header with language label.
  • Code block copy action with copied feedback.

Test affordances

  • iOS accessibility identifiers for details/codeblock checks.
  • Android Compose test tags for details/codeblock checks.
  • Dedicated E2E test coverage for hn:details + hn:codeblock probes.

iOS Swift Fixes (post-merge breakage)

A merge left iOS dev-tool wiring in an inconsistent state; this PR fixes that:

  • Reconnected developer profile cache wipe action through app manager/view wiring.
  • Updated MyNpubQrSheet/ChatListView/ContentView plumbing for the new callback.
  • Tightened hypernote accessibility identifiers/structure to make UI tests target the right elements consistently.

E2E Failure Saga + Fixes

What was failing

just ios-ui-e2e-local and related local deterministic flows were flaky or timing out (often at long 180s waits), even though manual behavior looked mostly fine.

Root causes we found

  1. Bot harness welcome handling was not robust across multiple test cases in one run.
  2. Additional welcome subscription used since(now), which can miss backdated NIP-59 giftwrap events.
  3. Per-message timeout behavior in harness loops was too coarse / not aligned with nostr expectations.
  4. iOS XCTest waits were overly long, masking failures and slowing feedback loops.

Harness + test fixes

  • Added 1s per-message timeout behavior in nostr receive loops while preserving overall scenario deadlines.
  • Updated additional welcome subscription to include lookback (since(now - lookback)), so backdated giftwraps are still seen.
  • Kept bot subscribed for additional welcomes to support multi-test suite behavior.
  • Reduced local iOS UI E2E step waits to 10s for fast deterministic failure feedback.
  • Added optional relay event logging attach point:
    • PIKA_RELAY_LOG_EVENTS=1 in relay binary.
    • Enabled from local fixture startup for debugging runs.

Android-specific test fixes

Compile break in CI

CI failed on unresolved assertDoesNotExist in androidTest. Fixed by replacing it with a compatibility-safe helper based on onAllNodesWithTag(...).fetchSemanticsNodes().

Hypernote runtime failure

e2e_hypernoteDetailsAndCodeBlock then failed at copied-indicator assertion.

Root cause:

  • Copied UI was rendered inside a fixed-size IconButton content slot, so the tagged copied text was not reliably a displayed node.

Fix:

  • Render copied feedback as its own visible row with HYPERNOTE_CODEBLOCK_COPIED tag (outside the constrained icon-only slot).
  • Updated test helper to wait for any displayed node for that tag.

UI E2E Video Recording (theoretical + implementation)

Video recording is now wired into deterministic local UI E2E harness runs, gated by env var:

  • Enable with: PIKA_UI_E2E_RECORD_VIDEO=1
  • Preserve outputs with: KEEP=1

Behavior:

  • iOS: starts xcrun simctl io <udid> recordVideo, stops at test completion, stores MP4 under scenario artifacts.
  • Android: starts adb shell screenrecord, stops/pulls MP4 at test completion, stores MP4 under scenario artifacts.
  • Captured MP4s are added to ScenarioRunOutput.artifacts and included in summary metadata/artifacts.

Note: recording is optional and off by default.

Validation

Representative local validations run during this saga:

  • just ios-ui-e2e-local passing after harness/iOS timeout fixes.
  • nix develop -c ./android/gradlew -p android :app:compileDebugAndroidTestKotlin passing after androidTest API fixes.
  • nix develop -c env KEEP=1 PIKA_ANDROID_E2E_TEST_CLASS='com.pika.app.PikaE2eUiTest#e2e_hypernoteDetailsAndCodeBlock' just android-ui-e2e-local passing after copied-indicator fix.

Commits of note in this branch

  • 920fe1f Stabilize local iOS E2E relay flow and tighten step timeouts
  • b115a04 fixing android e2e ui test (compile API compatibility)
  • 6f100d9 Add optional UI E2E video capture for iOS and Android
  • plus follow-up Android hypernote copied-indicator/displayability fix in this branch

futurepaul and others added 2 commits March 1, 2026 23:48
- Add Details and Summary to the hypernote component catalog
- Render Details as a collapsible disclosure on iOS (custom button)
  and Android (AnimatedVisibility) with full-row tap target
- Update code block rendering with a top bar showing language name
  and a copy-to-clipboard button with "Copied" toast feedback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@futurepaul futurepaul marked this pull request as draft March 2, 2026 06:17
futurepaul and others added 3 commits March 2, 2026 11:22
- Add hn:details and hn:codeblock probe handlers to pika-e2e-bot
- Add accessibility identifiers (iOS) and test tags (Android) to
  DetailsDisclosure and CodeBlockView components
- Add testE2E_hypernoteDetailsAndCodeBlock to iOS and Android E2E suites
- Wire up new iOS test in ui-e2e-local -only-testing list
- Fix x86_64 linker failure by adding EXCLUDED_ARCHS=x86_64 to xcodebuild

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The pikahub E2E infrastructure uses `pikachat bot` (Rust), not
`tools/pika-e2e-bot` (shell). The Rust bot only handled bare `ping`
and `openclaw: reply exactly` protocols, missing the `ping:<nonce>`
format that the iOS/Android E2E tests use.

- Add ping:<nonce> -> pong:<nonce> to parse_openclaw_prompt
- Add pika-e2e:<nonce> legacy alias
- Add hn:details and hn:codeblock hypernote probe handlers
- Keep bot loop running for multiple probes (only exit on E2E_OK_*)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve conflict in tools/ui-e2e-local: master refactored the E2E
runner into pikahut Rust integration tests. Take master's version
and add EXCLUDED_ARCHS=x86_64 + hypernote test to the Rust scenario.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GroupInfoView.swift:279 used the iOS 17+ two-parameter onChange
closure which broke the build on iOS 16 deployment target. Switch
to the existing onChangeCompat helper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- cap nostr recv waits to 1s per message while preserving overall deadlines\n- keep bot subscribed for additional welcomes with lookback to handle backdated giftwraps\n- add optional local relay event logging and enable it in pikahut fixture\n- route dev-tool profile-cache wipe action and improve hypernote accessibility hooks\n- reduce local iOS E2E step waits to 10s for faster failure feedback
- record simulator video during iOS local UI E2E runs\n- record emulator screen during Android local UI E2E runs\n- pull captured mp4 files into scenario artifact directories\n- include captured videos in ScenarioRunOutput artifacts when present\n- gate behavior with PIKA_UI_E2E_RECORD_VIDEO=1
- make copied feedback render as a visible tagged row instead of fixed-size IconButton content\n- update android E2E helper to wait for any displayed tagged node\n- resolves flaky/failing hypernote copied assertion in local deterministic android UI E2E
@futurepaul futurepaul marked this pull request as ready for review March 3, 2026 02:09
- finalize iOS/Android recording processes gracefully so mp4 files are playable\n- write recordings to gitignored root screen_recordings/ with timestamped filenames\n- replace old iOS relay investigation doc with a how-to for UI E2E with video flags\n- restore AGENTS.md intro guidance from master (agent-brief lines)
@futurepaul
Copy link
Collaborator Author

futurepaul commented Mar 3, 2026

@futurepaul futurepaul merged commit 6965077 into sledtools:master Mar 3, 2026
16 checks passed
@futurepaul futurepaul deleted the hypernote-details branch March 3, 2026 02:26
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