Skip to content

feat(ui): promote real applicant commit CTA into Participate applicant rail - #222

Merged
MontrealAI merged 1 commit into
mainfrom
codex/add-on-chain-commit-button-to-ui
Apr 2, 2026
Merged

feat(ui): promote real applicant commit CTA into Participate applicant rail#222
MontrealAI merged 1 commit into
mainfrom
codex/add-on-chain-commit-button-to-ui

Conversation

@MontrealAI

Copy link
Copy Markdown
Owner

Motivation

  • Fix the blocking product defect where the primary applicant commit flow was only a local helper and not visibly wired to the on‑chain commitApplication(...) write in the Participate experience.
  • Make the Participate > Applicant rail the flagship, above‑the‑fold on‑chain execution surface while keeping the archive clearly secondary and local‑only.

Description

  • Added a visible primary CTA stack in the Participate > Applicant rail including applicantCommitApplicationButton (label: "Commit application on-chain"), applicantApproveStakeButton and applicantRevealApplicationButton, and an immediately visible blockers list applicantCommitBlockers above the fold in ui/agijobmanager_genesis_job_mainnet_2026-04-03.html.
  • Wired the review-first flow so confirmation executes the real contract write: agiJobDiscovery.methods.commitApplication(pid, commitment, subdomain, proof).send({from:userAccount}) via helpers openApplicantCommitReview() and submitApplicantCommit(); on success the packet is persisted locally and UI state updated to "On-chain committed".
  • Implemented applicant readiness/allowance logic: buildApplicantCommitBlockers(state) enforces contract-fidelity checks (paused, procurement exists/not cancelled, pause-adjusted time windows, normalized subdomain & authorization, reputation threshold, not already committed, applicant cap, commitment validity, balance/allowance when stake > 0); added refreshApplicantAllowanceState() and an approve action wired to Discovery as spender.
  • Kept and preserved existing local packet & commitment generation UX but demoted the lower archive to Advanced local packet archive (secondary) with explicit local-only copy and message; commitment helpers remain in the primary applicant panel (solidity-packed hashing using web3.utils.soliditySha3).

Testing

  • Ran npm run check:no-binaries which passed with no forbidden binary additions.
  • Ran npm run docs:check which passed documentation checks.
  • Verified UI ABI validation: npm run ui:abi:check initially failed due to missing build artifacts, then executed npx truffle compile to produce artifacts and re-ran npm run ui:abi:check which passed.

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

ℹ️ 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($('applicantCommitApplicationButtonSticky')) $('applicantCommitApplicationButtonSticky').disabled = true;
return;
}
if(!pid || !agiJobDiscovery?.methods) return;

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 Reset applicant readiness when procurement context is missing

In refreshParticipate, returning early on missing pid or contract methods leaves applicantCommitReadiness and button state untouched from the previous load, so a previously ready applicant can clear/switch procurement and still open openApplicantCommitReview() with stale readiness. In that state the UI can attempt commitApplication with empty or outdated inputs, causing wrong-procurement submissions/reverts and wasted gas; this path was previously guarded by resetting blockers and disabling commit controls before returning.

Useful? React with 👍 / 👎.

@MontrealAI
MontrealAI merged commit 367e60e into main Apr 2, 2026
4 checks passed
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