Skip to content

Upgrade UI to v25: mobile dock rename, admin control surfaces, ABI & runtime refactor, bond/approval flow improvements#1453

Open
MontrealAI wants to merge 2 commits intomainfrom
codex/upgrade-agijobmanager-ui-to-v25-qd3h8u
Open

Upgrade UI to v25: mobile dock rename, admin control surfaces, ABI & runtime refactor, bond/approval flow improvements#1453
MontrealAI wants to merge 2 commits intomainfrom
codex/upgrade-agijobmanager-ui-to-v25-qd3h8u

Conversation

@MontrealAI
Copy link
Copy Markdown
Owner

Motivation

  • Canonicalize the mobile enhancement feature set to a new v25 variant and modernize UX copy for bond math and approvals.
  • Surface robust on-chain admin controls in the UI so owners/moderators can inspect and invoke routine and high-risk methods safely.
  • Harden runtime state, ABI discovery, and approval/confirmation flows to reduce read failures, degraded fallbacks, and accidental transactions.

Description

  • Renamed mobile enhancement CSS/JS IDs and classes from v23 to v25 and updated the mobile dock/sheet code and labels (#v25MobileDock, #v25MobileSheet, v25* functions and timers).
  • Added an Admin Control Surfaces panel (#adminControlSection) and implemented helper functions for rendering posture badges, control buttons, and an executeAdminControl handler that validates owner/moderator posture and routes calls to AGIJobManager or ENSJobPages.
  • Replaced ad-hoc appState with a structured APP_STATE object and added resetRuntimeState plus jobsReadDegraded flags; updated job index read logic to mark degraded fallbacks and display warnings.
  • Refactored ABI enrichment to ensureAbiMethods and added many admin/management method definitions for AGIJobManagerABI and ENSJobPagesABI.
  • Reworked action review/confirmation flow to use a single requestActionConfirmation/pendingActionConfirmResolver pattern and replaced previous requestSimpleReview usages; updated token approval flows to use the new confirmation UI.
  • Centralized protocol numeric getters with getProtocolBigInt and getProtocolNumber, renamed and adjusted agent bond computation to computeAgentBondExactForJob (uses protocol state values for bps/min/max/duration limit), and updated calculator/approval paths to use the new functions.
  • Introduced ensLabelPreviewForJobId and switched various UI areas to show predictable ENS label previews instead of implicit job-N strings.
  • Miscellaneous UX and housekeeping: bumped UI createdVia version to v25.0, changed several helper copy lines, adjusted TX_ACTIVITY_KEY name, simplified loadTxActivity fallback, and improved wallet/connection error messages.

Testing

  • No automated tests were executed as part of this patch.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3511f0a75a

ℹ️ 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".

}
function loadTxActivity(){
try{ txActivity = JSON.parse(localStorage.getItem(TX_ACTIVITY_KEY) || localStorage.getItem("agijobmanager_v17_tx_activity") || "[]"); }catch{ txActivity = []; }
try{ txActivity = JSON.parse(localStorage.getItem(TX_ACTIVITY_KEY) || "[]"); }catch{ txActivity = []; }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep loading tx activity from legacy v25 storage key

This change drops the fallback that previously read agijobmanager_v25_tx_activity, so users who already generated activity in the prior UI version will see an empty activity log after upgrading unless they also happen to have a v17 key. Because older builds wrote to the v25 key, this is a real migration regression; keep reading the old key (or migrate it once) before defaulting to [].

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 101ebc8fbe

ℹ️ 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".

Comment on lines +5622 to +5625
const moderatorMethods = new Set(['resolveDisputeWithCode','resolveStaleDispute']);
const authorized = target === 'ens'
? isEnsOwner
: (isManagerOwner || (isModerator && moderatorMethods.has(method)));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Align dispute-role gating with contract modifiers

The new admin authorization logic treats both resolveDisputeWithCode and resolveStaleDispute as moderator-capable while also allowing owners to invoke any manager method, but on-chain access control differs (resolveDisputeWithCode is onlyModerator and resolveStaleDispute is onlyOwner in contracts/AGIJobManager.sol). In environments where owner and moderator are not the same address, the UI will present these actions as authorized and then submit transactions that deterministically revert, wasting gas and breaking the admin dispute workflow.

Useful? React with 👍 / 👎.

Comment on lines +2432 to +2435
const primary = localStorage.getItem(TX_ACTIVITY_KEY);
if(primary){
txActivity = JSON.parse(primary || '[]');
}else{
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prefer latest tx activity key during local migration

loadTxActivity now unconditionally prefers agijobmanager_v17_tx_activity when it exists, and only reads the v25 key when v17 is missing. Users upgrading from the previous v25 build can easily have both keys (older v17 history plus newer v25 entries), and this path will silently load stale v17 data and hide recent v25 activity after upgrade.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant