Skip to content

Harden Alpha identity review UX and canonical state flow in v43 - #189

Open
MontrealAI wants to merge 1 commit into
mainfrom
codex/patch-alpha-agent-ui-for-premium-onboarding
Open

Harden Alpha identity review UX and canonical state flow in v43#189
MontrealAI wants to merge 1 commit into
mainfrom
codex/patch-alpha-agent-ui-for-premium-onboarding

Conversation

@MontrealAI

Copy link
Copy Markdown
Owner

Motivation

  • The Alpha-Agent identity review surface was visually and structurally debuggy, duplicated (legacy modal + new modal), and allowed blank/contradictory preview states to reach the public review flow. The UI must present one premium, contract-faithful signing surface for mainnet issuance.
  • The public registration route must remain direct and auditable (call register(string) on the pinned identity contract with value = 0).
  • The identity snapshot and state machine needed normalization so all panels derive from a single coherent source-of-truth and stale async results cannot corrupt the review path.

Description

  • Replaced the old token-dump review markup with a single executive review modal in ui/agijobmanager_genesis_job_mainnet_2026-03-05-v43.html that contains: hero header, route/source badges, decision summary strip, human-centric action facts, readiness section, and a collapsed "Advanced technical facts" area for selectors/calldata.
  • Added focused styles for the executive modal (.alphaIdentityExecutiveModal, .alphaReviewHero, .alphaReviewSection, etc.) to improve contrast, hierarchy, spacing, and mobile-safe-area behaviour.
  • Demoted raw calldata/selector/token tuples to the advanced disclosure and improved address presentation with short+copy+explorer affordances via formatIdentityReviewAddress and renderIdentityReviewList helper functions.
  • Unified the public review path by removing the legacy public Alpha mint review markup so only the canonical review modal is used for register, claimIdentity, and syncIdentityByLabel flows; legacy hidden controls remain inert and quarantined.
  • Hardened gating and modal-open logic so openAlphaIdentityReview now blocks until preview(label) and rootHealth() are fresh and consistent, and rejects opening when preview shows inconsistencies (prevents blank critical fields in review).
  • Normalized identity state labels and snapshot values (read_failed, preview_ready, preview_inconsistent, review_open, write_ready, etc.) and ensured APP_STATE.identity.snapshot is the single normalized snapshot used across decision UI and modal preflight.
  • Kept and made explicit direct contract parity metadata in APP_STATE.identity.parity so the review records contract, method, args, value:'0', chainId, from, and calldata for proof-of-parity with on-chain calls.
  • Updated test expectations to match the new modal architecture and state names in ui/tests/standaloneV43.test.ts.

Files changed:

  • ui/agijobmanager_genesis_job_mainnet_2026-03-05-v43.html — modal markup, CSS, helper functions, gating/state changes, parity recording, advanced facts demotion.
  • ui/tests/standaloneV43.test.ts — assertions updated to reflect state-name and markup changes.

Testing

  • Ran the standalone artifact unit test file with npx vitest run ui/tests/standaloneV43.test.ts and it passed: Tests 10 passed (10).
  • The updated test asserts direct write calls remain freeTrialRegistrarIdentity.methods.register(local.label).send({from:userAccount, value:'0'}), that parity metadata is recorded, and that the deterministic state machine names are present and consistent.

Codex Task

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

Copy link
Copy Markdown

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: e233abff00

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

node.innerHTML = rows.map(([k,v])=>`<div class="alphaReviewRow"><span class="k">${escapeHtml(k)}</span><span class="v">${v}</span></div>`).join('');
node.querySelectorAll('[data-copy-value]').forEach((btn)=>btn.addEventListener('click', ()=>{
const value = btn.getAttribute('data-copy-value') || '';
navigator.clipboard?.writeText(value).then(()=>setToast('Copied to clipboard.','ok')).catch(()=>setToast('Clipboard unavailable in this browser.','warn'));

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 Guard clipboard copy path before chaining promise

When the Clipboard API is unavailable (e.g., insecure context or unsupported browser/webview), navigator.clipboard?.writeText(value) evaluates to undefined, so chaining .then(...) throws a runtime TypeError before the fallback toast can run. This means clicking the new review-modal Copy button can fail noisily instead of degrading gracefully in exactly the environments where this fallback is needed.

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