feat: add markdown code block copy button (#324)#2
Merged
Conversation
* 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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Checklist