Plan the next Lua UI migration after the HUD packages
Inspect current origin/develop remaining native UI and select the next bounded Lua migration. Planning only; no implementation. Worktree /home/mathias/Projects/worktrees/engines-next-lua-plan, branch feature/plan-next-lua-migration, base 2fd6c0fd7. Leave original checkout and concurrent work untouched. Reuse existing package/provider, shared window/table and native authority patterns. Acceptance: verify shortlisted paths against source; recommend scope, ownership, reuse, risks and behavior-focused validation; preserve explicit limits on unrun checks. Recommendation: migrate Friends next as one replaceable prk.friends package. FriendsPresenter.cs owns six-column table composition, online colors, name entry, note chips and actions; FriendsWindow.cs owns native frame registration, prompts/confirmation and inspection. ClientBuddyState already supplies immutable revisioned buddy snapshots. Preserve friends_window character placement/open/pin identity and listview_config sort/column widths. Lua owns frame, table schema, sort/display formatting, note-chip reconciliation and entry presentation; native retains buddy/ignored state, install-backed profession/location resolution, lookup/send completion, note validation, dialogs, current-member checks and packet dispatch. Retain current native context-menu/inspection route with revalidation, rather than expanding this into a generic Lua dialog/menu system. Implementation sequence (not performed): 1. Extend existing core.table with bounded package-local custom/host cells. One create/update/retire lifecycle, package-owned template and callbacks receiving the current row; clear removed notes and release callbacks on shrinking/rebinding. No parallel Friends-specific table engine. Preserve existing text/icon users and shared sorting/preferences. 2. Extract FriendNoteRules validation from FriendsPresenter into native Friends command policy; use current friend/note references revalidated on every action and deferred prompt/confirmation callback. Keep normalization/count/duplicate notices native. Client.AddFriendNote currently does not enforce those presenter checks, so simply exporting that method is unsafe. Async name lookup clears only the submitted text after successful send and must not edit a changed field, disposed package or replacement session. Preserve Enter submission via explicit native input handling or a narrowly scoped secure submit capability; ui.on_text_changed is nonactivating and is not a substitute. 3. Add typed Friends adapter, XML/Lua package and provider role with normal selection/fallback/diagnostics; compose core.window/core.table; preserve ignored marking, online-first/name-tie order, unknown fields, offline blank location, note chips/+ controls, native context actions and prompts. Keep FriendsWindow as lifecycle/native-policy host and remove FriendsPresenter/legacy layouts and UiListViewPersistence consumer when superseded. Avoid per-frame snapshots/allocations when buddy and ignored revisions are unchanged. 4. Migrate behavior tests to real Lua components and native pointer/keyboard paths. Verify display/update/sort, per-note add/remove after row reorder/rebind, prompt target removal, failed/delayed add completion without clearing newer text, close/reopen/session teardown, persisted geometry/table settings, and notes changing on recycled rows. Prove regression checks fail when the relevant update/validation is removed. Run focused and full client/graphics suites and run-client-lua-tests.sh (native, sanitizers, generator and Native AOT); visually check note wrapping/clipping, sorting/resizing and dialog interaction in the real client. Alternatives: NPC dialogue is a coherent follow-up but currently combines AOML transcript paragraphs, a button bar and hand-over panel docked as sibling roots, native item drop/tooltips and server-driven close semantics (NpcChatPresenter/NpcChatController); do not bundle it with Friends. Compass is small but owns PannedSurface sprite/offset rendering and per-frame heading/waypoint projection, unlike the existing widget-only bridge. MarketPresenter directly owns async completion queue/generation, debounce and idempotency state alongside view controls, so it needs state extraction first. Options spans multiple settings categories and is broader than this slice. Evidence: opened FriendsPresenter, FriendsWindow, ClientBuddyState, relevant Client friend command methods, FriendsPresenterTests, Core README, package/provider docs, NpcChatPresenter/NpcChatController and CompassPresenter. Opened only MarketPresenter lines 1–160; market conclusions limited to fields/wiring there. Searched core.table implementation and provider/input declarations; those search hits are not full-file reviews. Read-only source planning; no builds, tests or live gameplay run. Worktree clean; original checkout untouched.
Checklist
2 of 2 complete- Trace remaining candidates and verify the recommended slice's existing native ownership and shared Lua gaps.
- Record bounded migration scope, reuse, authority/lifecycle risks and meaningful validation plan; distinguish planning from implementation.
- Area
- Project Rubi-Ka
- Project
- engines
- Kind
- Research
- Task ID
tsk_sj459g5jgn- Updated