Replace custom site and option pickers with pi-tui SelectList#2812
Replace custom site and option pickers with pi-tui SelectList#2812youknowriad wants to merge 1 commit intotrunkfrom
Conversation
📊 Performance Test ResultsComparing 60e545e vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
Adopt SelectList component for both site picker and option picker, deleting ~120 lines of custom list rendering, pagination, and navigation code. Both pickers now delegate scrolling, selection, and keyboard handling to SelectList, while keeping custom features (tab switching, contains-based search filtering, browser-open-on-tab) as thin wrappers. Minor UX changes: selection prefix changes from ❯ to →, navigation wraps around, scroll indicator format changes. Hide editor bottom bar (hints + status message) while site picker is visible. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
dcd14ad to
60e545e
Compare
|
@youknowriad I get stuck when first switching to remote sites, then about 3 minutes later the message "Not logged in. Use /login first." shows up. |
|
What's the expected outcome when switching to remote sites, since we don't have copy...? |
|
I think the next step would be to copy the remote site locally and then be able to push it. Currently it's functionless. |
I don't reproduce this btw. |
|
My guess is that we may not handle expired tokens properly or things like that but it seems to be out of scope of the current PR. |
Related issues
How AI was used in this PR
AI explored the codebase, designed a refactoring plan to adopt pi-tui's SelectList component, and implemented the changes. The plan identified that SelectList already handles list rendering, scrolling, keyboard navigation, and selection — eliminating the need for custom implementations. AI built in custom logic for features SelectList doesn't cover (tab switching, contains-based filtering, browser-open-on-tab).
Proposed Changes
formatSiteRow,getSitePickerRows,getVisibleWindow,getScrollInfo,sitePickerPageSize) with SelectList. Maintains custom tab switching (local/WordPress.com), contains-based search filtering, and tab-to-open-browser.showBottomBarflag to hide hint/status line while site picker is visible, reducing visual clutter.getFilteredSitePickerItems()intorebuildSitePickerList()to avoid indirection; SelectList is recreated on every query change with pre-filtered items (working around SelectList's prefix-only filtering).Testing Instructions
npm run cli:build && node apps/cli/dist/cli/main.js ai[Local]tab and→indicator should align with prompt textPre-merge Checklist