← Back to PRs

#18676: feat: add patch-ui.sh

by jasonkneen open 2026-02-16 23:41 View on GitHub →
app: web-ui size: S
This PR adds a development utility script for patching the live OpenClaw UI with local changes. **Changes:** - Add patch-ui.sh script for patching installed UI with development builds - Builds UI, backs up current installation, patches with new build - Dynamically detects OpenClaw installation location - Handles gateway restart for immediate effect - Cross-platform compatibility improvements **Features:** - ✅ Automatic backup of original UI (first run only) - ✅ Dynamic PATH and Node.js version detection - ✅ Portable lsof usage or fallback to openclaw gateway restart - ✅ Clear progress output and error handling - ✅ Easy restore instructions **All Automated Review Feedback Addressed:** - ✅ Removed hardcoded /opt/homebrew/bin PATH (now dynamic brew detection) - ✅ Removed hardcoded Node version v22.14.0 (now uses dynamic openclaw/npm detection) - ✅ Replaced hardcoded /usr/sbin/lsof with portable lsof command or openclaw gateway restart - ✅ Added cross-platform compatibility and better error handling **Usage:** ✗ openclaw command not found. Please install OpenClaw first. Perfect for UI development workflow - make changes, run script, test immediately. **Testing:** - All linting checks passed ✓ - No personal paths in diff ✓ <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR adds a development utility script `patch-ui.sh` that enables rapid UI development by building and patching the live OpenClaw installation with local changes. The script includes dynamic path detection for OpenClaw installation, automatic backup functionality, and cross-platform gateway restart capabilities. **Major Changes:** - New `patch-ui.sh` script with dynamic OpenClaw installation detection via `which openclaw` and npm root - Added `pnpm run patch` convenience script to `ui/package.json` - Automated backup of original UI on first run - Gateway restart logic with `lsof` fallback to `openclaw gateway restart` **Critical Issues Found:** - Two git worktree references (`apps/.auto-claude/worktrees/tasks/*`) were accidentally committed as gitlink entries. These violate the repository's multi-agent safety guidelines in `AGENTS.md` and must be removed before merging. - Logic flaw in gateway restart code (lines 76-80) where the `openclaw gateway restart` fallback won't execute when `lsof` is available but finds no running process. The core script functionality is solid for its intended purpose, but the accidental worktree commits are a blocker for merge. <h3>Confidence Score: 2/5</h3> - This PR has critical issues that must be resolved before merging - Score of 2 reflects two critical issues: (1) accidentally committed git worktree references that violate repository guidelines and should never be in version control, and (2) a logic bug in the gateway restart fallback that prevents the intended fallback behavior. The core patch-ui.sh functionality is sound, but these issues require immediate attention. - The two worktree reference files under `apps/.auto-claude/worktrees/tasks/` must be removed entirely. The `patch-ui.sh` script needs the restart logic fixed at lines 76-80. <sub>Last reviewed commit: 2298f1a</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs