Skip to content

feat: add markdown code block copy button (#324)#2

Merged
tjipenk merged 1 commit into
tjipenk:mainfrom
a-ghorbani:main
Jun 10, 2025
Merged

feat: add markdown code block copy button (#324)#2
tjipenk merged 1 commit into
tjipenk:mainfrom
a-ghorbani:main

Conversation

@tjipenk
Copy link
Copy Markdown
Owner

@tjipenk tjipenk commented Jun 10, 2025

  • feat: add markdown code block copy button

  • fix(lint): resolve linting issue

  • chore: use copy icon from assets and add accessibility padding to copy button


Description

Provide a brief description of the changes made and the issue(s) this resolves.

Fixes # (issue number)

Platform Affected

  • iOS
  • Android

Checklist

  • Necessary comments have been made.
  • I have tested this change on:
    • iOS Simulator/Device
    • Android Emulator/Device
  • Unit tests and integration tests pass locally.

* feat: add markdown code block copy button

* fix(lint): resolve linting issue

* chore: use copy icon from assets and add accessibility padding to copy button

---------

Co-authored-by: a-ghorbani <ghorbani59@gmail.com>
@tjipenk tjipenk merged commit 34531cd into tjipenk:main Jun 10, 2025
1 of 3 checks passed
tjipenk pushed a commit that referenced this pull request May 11, 2026
* feat(perf): use external files dir on Android for adb pull compatibility

Write memory snapshots to getExternalFilesDir() instead of filesDir
so adb pull works without root access on real devices.

* feat(perf): add JS memory helper, trigger component, and deep link handler

- takeMemorySnapshot/clearMemorySnapshots/readMemorySnapshots utilities
- MemorySnapshotTrigger: hidden component for Android E2E (TextInput setValue)
- Deep link handler (pocketpal://memory?cmd=...) for iOS E2E
  (XCUITest sendKeys doesn't fire onChangeText in Release builds)
- Mounted in App.tsx, jest mocks for native methods

* feat(perf): add E2E memory profiling spec and helpers

- 7-checkpoint spec: launch → models → chat → model loaded → active → idle → unloaded
- Platform-specific triggers: deep links (iOS), TextInput setValue (Android)
- Platform-specific file reading: simctl/ios-deploy (iOS), app read:: command (Android)
- driver.capabilities for device info (multi-device safe)

* feat(perf): add comparison script and shell wrapper

- memory-compare.ts: budget thresholds + leak detection (>110% post-unload)
- memory-profile.sh: orchestrates build → E2E → compare
- 7 unit tests for comparison logic

* fix: prettier formatting after merge with main

* feat(perf): add initial memory baselines for Qwen3-1.7B Q4_K_M

Pixel 9 (Android 16): peak PSS 1,820 MB
iPhone 13 Pro (iOS 26.3): peak phys 419 MB, Metal 1,743 MB

Captured on llama.rn 0.11.5 with 2 chat messages.

* fix: implement baseline comparison, fix iOS return type, fix device name

- compareReports now actually compares: per-checkpoint delta detection
  flags regressions > 15% (configurable via --regression-pct)
- Fix iOS writeMemorySnapshot to return {label, status} matching spec
- Fix iOS baseline device name from "agh" to "iPhone 13 Pro"

* fix: use tsx instead of ts-node for CLI scripts (Node types compat)

* feat: auto-save comparison results next to profile report

* fix: simplify comparison to delta-only with dual threshold

Remove budget ceiling and leak detection (unreliable). Comparison now
only shows per-checkpoint delta (MB and %) vs baseline. Flags regression
when BOTH delta > 10% AND delta > 200 MB (both configurable via
--pct and --mb flags). Auto-saves result alongside the profile report.

* fix: address review findings

- Restore qwen3-0.6b fixture, add qwen3-1.7b as separate entry (a-ghorbani#10)
- Cache MTLDevice as static to avoid re-init on every snapshot (#2)
- Remove debug state concatenation in handleChangeText (a-ghorbani#4)
- Fix set -e vs exit code capture in memory-profile.sh (a-ghorbani#7)
- Remove unused getMemoryProfile() from iOS, Android, spec, mock (a-ghorbani#12)

* fix: include metal_allocated in iOS memory comparison and peak calculation

iOS Metal GPU memory is the dominant cost for LLM inference (~1.7 GB
for Qwen3-1.7B). Comparison now uses phys_footprint + metal_allocated
as the total on iOS. Peak calculation in E2E spec also updated.

* fix: regenerate baselines with phys+metal peak calculation
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