UI/mobile v25 + admin control surfaces; ABI, state, and approval flow refactor#1452
UI/mobile v25 + admin control surfaces; ABI, state, and approval flow refactor#1452MontrealAI wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab81adb7e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if(!requireConnected() || !mustBeReadyToWrite()) return; | ||
| const contract = target === 'ens' ? ensJobPages : agiJobManager; | ||
| const argInput = prompt(`Optional comma-separated args for ${method}`); | ||
| const args = String(argInput || '').trim() ? String(argInput).split(',').map(x=>x.trim()) : []; | ||
| const ok = await requestActionConfirmation({ |
There was a problem hiding this comment.
Enforce admin role checks before sending admin txs
This handler only gates on connectivity/write readiness and then proceeds to execute any selected admin method, so non-owner/non-moderator wallets can still submit owner-only calls from the new admin surface; those calls will revert on-chain after submission and users will still pay gas. Because the previous flow had explicit role checks, this is a regression that can cause avoidable fund loss for any connected mainnet user exploring these controls.
Useful? React with 👍 / 👎.
| function resetRuntimeState(reason='context reset'){ | ||
| activeJobIndexCache.ids = null; | ||
| activeJobIndexCache.ts = 0; | ||
| jobCache.clear(); | ||
| latestJobs = []; | ||
| APP_STATE.jobsReadDegraded = false; | ||
| APP_STATE.admin = {managerOwner:null, ensOwner:null, isModerator:false}; | ||
| if(reason) console.info('[resetRuntimeState]', reason); |
There was a problem hiding this comment.
Clear visible runtime UI state on context reset
The reset path now clears only caches/state objects and no longer clears rendered job/admin fields, so when account or network context changes (including wallet disconnect flows that return immediately after reset), the page can keep showing stale data from the previous session. This is misleading for operators because ownership/posture/job information appears current even though the runtime context has been invalidated.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb94ce5b78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const isOwner = managerOwner && account === managerOwner; | ||
| if(isOwner) return {ok:true, role:'manager-owner'}; | ||
| const moderatorMethods = new Set(['resolveDisputeWithCode','resolveStaleDispute']); | ||
| if(APP_STATE.admin?.isModerator && moderatorMethods.has(method)) return {ok:true, role:'moderator'}; |
There was a problem hiding this comment.
Match admin role checks to on-chain modifiers
isAuthorizedForAdminMethod currently authorizes the connected owner for every manager admin call and also treats resolveStaleDispute as a moderator method, but on-chain permissions are split the other way for these dispute functions (resolveDisputeWithCode is onlyModerator, while resolveStaleDispute is onlyOwner in contracts/AGIJobManager.sol). In practice, an owner who is not a moderator (or a moderator who is not owner) will be told they are authorized, sign the tx, and then hit a revert on-chain after paying gas.
Useful? React with 👍 / 👎.
Motivation
AGIJobManagerandENSJobPageswithout littering the primary layout.Description
v23tov25(IDs, classes, script id, and related functions) and updated the mobile shell wiring accordingly.Admin Control Surfacescard with generated routine/danger control lists and UI helpers (postureBadge,adminControlButton) and anexecuteAdminControlflow to prompt, confirm, and submit admin methods toagiJobManagerorensJobPages.ensureAbiMethodsto add many administrative/read functions toAGIJobManagerABIandENSJobPagesABI(owner/moderators, pause/unpause variants, blacklist/delist/rescue/resolution methods, ENS setters, etc.).APP_STATEand replaced scatteredappStateusage, addedresetRuntimeState,jobsReadDegradedtracking, and improved event-read fallbacks aroundgetActiveJobIdsFromEventswith clearer degraded-mode behavior and toasts.requestSimpleReviewwithrequestActionConfirmation/openActionReviewthat use a promise-resolver pattern (pendingActionConfirmResolver) and tightened review UI/confirm behavior for approvals and admin calls.getProtocolBigInt, introducedensLabelPreviewForJobId, and renamed/refactored bond computation functions tocomputeAgentBondExactForJoband related callers to better use on-windowprotocolStatevalues.createdViabumped tov25.0, copy adjustments in calculators and helper text, and some localStorage key handling consolidated for TX activity.Testing
Codex Task