prototype: Faris r2 corrections + DAO tier proposal form - #6
Conversation
- dao.html: proposal form with 5 listing tiers (Freebies/Bronze/Silver/Gold/Platinum), tier-locked platform share, live split validation, Freebies price-lock clears on tier switch - benefits.html: stepper strip removed, CTA re-routed to dao.html - content.html + dashboard.html: progress bars restored - traction.html: thin redirect to dao.html; full traction content lives in DAO Traction tab - subscribe.html: split-card removed, keeps sole stepper - UNLOCKED badges to quiet text + ACCESS buttons; DAO governance copy replaces fixed 70/20/10 - SPEC.md synced (Gold tier 2% platform fee confirmed from Canva flowchart) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe prototype updates subscription confirmation, content access, traction navigation, shared mock data, and DAO screens. Traction now routes to DAO detail views, while DAO proposals support tier-based fees and validated partner distributions. ChangesPrototype flow overhaul
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Browser
participant dao.html
participant KDATA
Browser->>dao.html: Open DAO list or detail view
dao.html->>KDATA: Read DAO packages, stats, payouts, and activity
KDATA-->>dao.html: Return DAO mock data
dao.html-->>Browser: Render DAO panels and tabs
Browser->>dao.html: Select tier and edit partner split
dao.html->>dao.html: Validate tier inputs and 100% total
dao.html-->>Browser: Enable or disable proposal submission
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@prototype/app.js`:
- Around line 125-128: Update the payout activity entries following the 10 USDC
Subscribe record to match the configured 45/30/15/10 DAO distribution: use the
correct recipients and corresponding payout amounts instead of the current
project-owner +7 USDC and community-manager +2 USDC values, while preserving the
existing activity structure.
In `@prototype/dao.html`:
- Around line 459-498: Update the partner selection and add-partner flows around
renderPartnerRows and the add-partner click handler to prevent duplicate
partnerIds in partnerRows. Reject or ignore selections already used by another
row, and disable or otherwise prevent adding a row when all KDATA.partners are
already assigned; preserve split validation only for unique beneficiaries.
- Around line 102-109: Update the DAO tab buttons in the sections identified by
data-tab and the corresponding tab group to expose their state: add
aria-controls targeting each panel and initialize aria-pressed to true only for
the active Profile tab. In the tab-switching logic, update aria-pressed whenever
the active panel changes, setting the selected tab true and all others false;
apply the same behavior to the additional tab group.
In `@prototype/SPEC.md`:
- Line 91: Update the contract identity instruction in SPEC.md to point to the
DAO Traction tab at dao.html?dao=<partner-id>, replacing the reference to
traction.html and keeping it consistent with the instructions on Lines 112 and
190.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2dd6a1cd-4595-44c2-aabe-cd9c61463e6f
📒 Files selected for processing (11)
prototype/SPEC.mdprototype/app.jsprototype/benefits.htmlprototype/content.htmlprototype/dao.htmlprototype/dashboard.htmlprototype/ebook.htmlprototype/index.htmlprototype/partner.htmlprototype/subscribe.htmlprototype/traction.html
| { kind: "Subscribe", detail: "10 USDC, split by DAO governance", addr: "GAJX…K3TQ", reward: "+10 USDC", when: "2m ago" }, | ||
| { kind: "Payout", detail: "to project owner", addr: "GDMV…HK2A", reward: "+7 USDC", when: "2m ago" }, | ||
| { kind: "Payout", detail: "to community manager", addr: "GDS7…M7FQ", reward: "+2 USDC", when: "2m ago" }, | ||
| { kind: "Subscribe", detail: "10 USDC split 7 / 2 / 1", addr: "GCRZ…9WLN", reward: "+10 USDC", when: "18m ago" }, | ||
| { kind: "Subscribe", detail: "10 USDC, split by DAO governance", addr: "GCRZ…9WLN", reward: "+10 USDC", when: "18m ago" }, |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Align payout activity with the new DAO split.
The 10 USDC subscription is still followed by the old +7 project-owner and +2 manager payouts. Update the recipients and amounts to represent the configured 45/30/15/10 distribution; otherwise the DAO Traction feed presents conflicting split data.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@prototype/app.js` around lines 125 - 128, Update the payout activity entries
following the 10 USDC Subscribe record to match the configured 45/30/15/10 DAO
distribution: use the correct recipients and corresponding payout amounts
instead of the current project-owner +7 USDC and community-manager +2 USDC
values, while preserving the existing activity structure.
| <section class="card" aria-labelledby="dao-tabs-label"> | ||
| <div class="label section-label" id="dao-tabs-label">SECTIONS</div> | ||
| <div class="row tight" id="dao-tabs"> | ||
| <button class="pill tab-btn active" type="button" data-tab="profile">Profile</button> | ||
| <button class="pill tab-btn" type="button" data-tab="packages">Packages</button> | ||
| <button class="pill tab-btn" type="button" data-tab="traction">Traction</button> | ||
| <button class="pill tab-btn" type="button" data-tab="proposals">Proposals</button> | ||
| </div> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Expose the active DAO section to assistive technology.
The visual active state is not announced. Add aria-controls/aria-pressed and update the latter when switching panels.
Proposed fix
-<button class="pill tab-btn active" type="button" data-tab="profile">Profile</button>
+<button class="pill tab-btn active" type="button" data-tab="profile"
+ aria-controls="tab-profile" aria-pressed="true">Profile</button> document.querySelectorAll(".tab-btn").forEach(function (b) {
- b.classList.toggle("active", b === btn);
+ var active = b === btn;
+ b.classList.toggle("active", active);
+ b.setAttribute("aria-pressed", active ? "true" : "false");
});Also applies to: 337-343
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@prototype/dao.html` around lines 102 - 109, Update the DAO tab buttons in the
sections identified by data-tab and the corresponding tab group to expose their
state: add aria-controls targeting each panel and initialize aria-pressed to
true only for the active Profile tab. In the tab-switching logic, update
aria-pressed whenever the active panel changes, setting the selected tab true
and all others false; apply the same behavior to the additional tab group.
| function renderPartnerRows() { | ||
| var el = document.getElementById("split-partners"); | ||
| el.innerHTML = partnerRows.map(function (row, index) { | ||
| var options = KDATA.partners.map(function (p) { | ||
| return '<option value="' + p.id + '"' + (p.id === row.partnerId ? " selected" : "") + '>' + escapeHtml(p.name) + '</option>'; | ||
| }).join(""); | ||
| return ( | ||
| '<div class="row split-row" data-index="' + index + '">' + | ||
| '<label>Partner' + | ||
| '<select class="split-partner-select" data-index="' + index + '">' + options + '</select>' + | ||
| '</label>' + | ||
| '<label>%' + | ||
| '<input class="split-partner-pct" type="number" min="0" max="100" step="1" value="' + row.pct + '" data-index="' + index + '">' + | ||
| '</label>' + | ||
| '</div>' | ||
| ); | ||
| }).join(""); | ||
| } | ||
|
|
||
| document.getElementById("split-partners").addEventListener("input", function (event) { | ||
| var target = event.target; | ||
| if (!target.classList.contains("split-partner-pct")) return; | ||
| partnerRows[Number(target.getAttribute("data-index"))].pct = Number(target.value); | ||
| updateSplitFeedback(); | ||
| }); | ||
|
|
||
| document.getElementById("split-partners").addEventListener("change", function (event) { | ||
| var target = event.target; | ||
| if (!target.classList.contains("split-partner-select")) return; | ||
| partnerRows[Number(target.getAttribute("data-index"))].partnerId = target.value; | ||
| render(); | ||
| }); | ||
|
|
||
| document.getElementById("add-partner").addEventListener("click", function () { | ||
| var used = partnerRows.map(function (row) { return row.partnerId; }); | ||
| var next = KDATA.partners.filter(function (p) { return used.indexOf(p.id) === -1; })[0] || KDATA.partners[0]; | ||
| partnerRows.push({ partnerId: next.id, pct: 0 }); | ||
| renderPartnerRows(); | ||
| updateSplitFeedback(); | ||
| }); |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Reject duplicate partners in a distribution.
Selecting an existing partner—or clicking Add Partner after all partners are used—creates duplicate beneficiaries that still pass split validation.
Proposed fix
var next = KDATA.partners.filter(function (p) {
return used.indexOf(p.id) === -1;
-})[0] || KDATA.partners[0];
+})[0];
+if (!next) return;
partnerRows.push({ partnerId: next.id, pct: 0 }); var valid = values.every(function (value) {
return Number.isFinite(value) && value >= 0 && value <= 100;
-}) && total === 100;
+});
+var partnerIds = partnerRows.map(function (row) { return row.partnerId; });
+var partnersUnique = new Set(partnerIds).size === partnerIds.length;
+valid = valid && total === 100 && partnersUnique;Also applies to: 506-514
🧰 Tools
🪛 ast-grep (0.44.1)
[warning] 460-474: Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: el.innerHTML = partnerRows.map(function (row, index) {
var options = KDATA.partners.map(function (p) {
return '<option value="' + p.id + '"' + (p.id === row.partnerId ? " selected" : "") + '>' + escapeHtml(p.name) + '';
}).join("");
return (
'
'Partner' +
'' + options + '' +
'' +
'%' +
'' +
'' +
'
);
}).join("")
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
(inner-outer-html)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@prototype/dao.html` around lines 459 - 498, Update the partner selection and
add-partner flows around renderPartnerRows and the add-partner click handler to
prevent duplicate partnerIds in partnerRows. Reject or ignore selections already
used by another row, and disable or otherwise prevent adding a row when all
KDATA.partners are already assigned; preserve split validation only for unique
beneficiaries.
| - Split card (THE `.split-flow` card, only glow use): `.num-label` (`03 AUTOMATIC SPLIT`), one sentence: the Soroban contract splits every payment the moment it settles. Then 3 `.alloc-row`s from `KDATA.split`: name, `.alloc-pct` (70%, 20%, 10%), `.alloc-amt` (7 XLM, 2 XLM, 1 XLM), `.alloc-track` + `.alloc-fill` (width = pct, classes from `cls`). | ||
| - Contract line under the rows: `.hint` with contract `code` chip `shortAddr`-style (use `shortHash(KDATA.contractId)` or first/last chars) + `title` full id. | ||
| - **Revised 2026-07-16 (Faris round-2 review): the Automatic Split card is removed.** The pay flow ends at the subscription card and the tx status area. Fee shares are not shown as a fixed split on this screen; they are dynamic and set by each community's DAO (see Screen 8 below). | ||
| - Contract line: no longer shown on this screen (it lived on the removed split card). Contract identity now surfaces on traction.html. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Point contract identity to the DAO Traction tab.
traction.html is now redirect-only, so this instruction contradicts Lines 112 and 190. Specify dao.html?dao=<partner-id> and its Traction tab instead.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@prototype/SPEC.md` at line 91, Update the contract identity instruction in
SPEC.md to point to the DAO Traction tab at dao.html?dao=<partner-id>, replacing
the reference to traction.html and keeping it consistent with the instructions
on Lines 112 and 190.
Prototype-only changes (no packages/web, no landing artifact).
Verified click-through locally on the prototype server before push.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Improvements