Skip to content

v26 standalone mainnet UI: live ENSJobPages resolution, ABI & admin UX hardening#1457

Open
MontrealAI wants to merge 1 commit into
mainfrom
codex/upgrade-agijobmanager-html-to-v26-ha2y3p
Open

v26 standalone mainnet UI: live ENSJobPages resolution, ABI & admin UX hardening#1457
MontrealAI wants to merge 1 commit into
mainfrom
codex/upgrade-agijobmanager-html-to-v26-ha2y3p

Conversation

@MontrealAI
Copy link
Copy Markdown
Owner

Motivation

  • Fix the stale ENS Job Page preview wiring and ensure the UI uses AGIJobManager.ensJobPages() as the live source of truth while providing a clearly labeled verified fallback.
  • Harden ENS/AGIJobManager ABI coverage and remove fragile local assumptions (e.g. job- label fallback and synthetic job-id fabrication) so on-chain reads drive the UI.
  • Replace native prompt/confirm/alert admin flows with an in-page, typed admin-argument modal and transaction review for safer, mobile-friendly admin operations.
  • Preserve the single-file architecture and existing feature set while improving mobile UX, state invalidation on context changes, and operational clarity.

Description

  • Introduced KNOWN_ENS_JOB_PAGES_FALLBACK = "0x06188e77c1c38d392b16d9d9fb24673363ce1da0" plus resolvedEnsJobPagesAddress and resolvedEnsJobPagesSource, and added resolveEnsJobPagesAddress() that reads agiJobManager.methods.ensJobPages().call() and applies the fallback only in a degraded state.
  • Rebuilt and expanded the ENSJobPagesABI and AGIJobManagerABI to match the provided sources (including accurate jobLabelSnapshot tuple signature and owner/write methods) and added additional ensureAbiMethods entries to expose operational reads/writes used by admin panels.
  • Rewrote ENS preview logic (updateEnsJobPagePreview) to instantiate ENSJobPages at the resolved address, surface contract reads (owner, ens, nameWrapper, publicResolver, jobsRootName/jobsRootNode, jobManager, jobLabelPrefix, nextJobId, jobLabelSnapshot, jobEnsLabel/jobEnsName/jobEnsURI/jobEnsNode, useEnsJobTokenURI, configLocked), parse tuple snapshots robustly, and show explicit rows: resolved address + source, owner, infra, link state, snapshot status, effective label/name/URI/node, token URI flags, and a public prerequisites summary (without claiming internal readiness).
  • Removed the old hardcoded 0xc19A84D10ed28c2642EfDA532eC7f3dD88E5ed94 usage and all local job- canonicalization fallbacks so preview and detail modal use jobEnsLabel and jobLabelSnapshot reads when available, otherwise show unavailable (not job-).
  • Replaced native prompt() admin argument collection with an in-page adminArgsModal and collectAdminMethodArgs() helpers; executeAdminControl() now opens the modal, validates typed args (type-aware handling for booleans), runs a transaction review (requestActionConfirmation / actionReviewModal), and then submits tracked transactions; no alert()/confirm()/prompt() remain.
  • Removed synthetic ID fabrication in degraded job-index fallback: when event coverage is missing, the UI now surfaces degraded read state and avoids inventing 0..nextJobId-1 as live IDs; getActiveJobIdsFromEvents() no longer returns synthetic lists and sets APP_STATE.jobsReadDegraded with clear toast guidance.
  • Improved runtime reset behavior to fully clear ENS/admin resolved address, previews, and controls on wallet disconnect / chain change and updated many ENS/manager admin panels to display resolved ENSJobPages address + source consistently.
  • Added mobile-first shell and v26 mobile enhancements (mobile dock and sheet), tightened styles for narrow screens, and updated visible version/copy references to v26 while preserving the single-file UI.

Testing

  • Verified output file presence with test -f ui/agijobmanager_genesis_job_mainnet_2026-03-05-v26.html (succeeded).
  • Ran targeted code searches to confirm removal/replacement of native dialogs and stale hardcoded ENS address: rg -n "prompt\(|alert\(|confirm\(|0xc19A84D10ed28c2642EfDA532eC7f3dD88E5ed94" and related patterns (no remaining native dialogs or the old address found; search succeeded).
  • Performed static greps to confirm new constants and resolution flow (KNOWN_ENS_JOB_PAGES_FALLBACK, resolvedEnsJobPagesSource, resolveEnsJobPagesAddress) are present (succeeded).
  • Attempted an automated browser render via the provided Playwright tool to capture a preview screenshot, but the runtime environment failed to open the local file URL and returned ERR_FILE_NOT_FOUND (tool limitation; not a failure of the artifact itself).
  • All automated checks executed in the workspace (file existence, code searches, and greps) passed; runtime integration validation should be performed in a browser connected to an Ethereum provider for full on-chain verification.

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: 2beb0b5aa8

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

}
activeJobIndexCache.ids = ids.slice();
activeJobIndexCache.ts = now;
APP_STATE.jobsReadDegraded = false;
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 Preserve degraded job-index state when event coverage is missing

getActiveJobIdsFromEvents marks the read path degraded when JobCreated coverage is missing, but this line clears APP_STATE.jobsReadDegraded before returning. That suppresses the degraded-state indicator used in the jobs summary (jobsVisibleSummary), so users can see an incomplete/empty index without the persistent degraded warning after the initial toast.

Useful? React with 👍 / 👎.

Comment on lines +3364 to +3366
}else if(KNOWN_ENS_JOB_PAGES_FALLBACK && !isZeroAddress(KNOWN_ENS_JOB_PAGES_FALLBACK)){
resolvedEnsJobPagesAddress = KNOWN_ENS_JOB_PAGES_FALLBACK;
resolvedEnsJobPagesSource = 'verified fallback';
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 Respect zero ensJobPages getter instead of forcing fallback

In resolveEnsJobPagesAddress, the fallback address is used whenever the manager getter does not produce a non-zero address, including the valid address(0) case where AGIJobManager.ensJobPages() is intentionally unset. In that scenario the UI silently binds ENS reads/admin actions to a different contract (verified fallback) instead of reflecting that the manager is unconfigured, which can misdirect operator decisions and transactions.

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