Conversation
Signed-off-by: prxt6529 <prxt@6529.io>
📝 WalkthroughWalkthroughAdds a GitHub publishing flow to the subscription footer: UI/state, backend POST integration, result/error modal, publish validation/tooltips, photo/airdrop upload handlers, and package.json script/dependency updates (baseline-browser-mapping, yaml). Changes
Sequence DiagramsequenceDiagram
actor User
participant Footer as ReviewDistributionPlanTableSubscriptionFooter
participant API as Backend API
participant Modal as GithubUploadModal
participant GitHub as GitHub
User->>Footer: Click "Publish to GitHub"
Footer->>Footer: set isUploadingToGithub = true
Footer->>API: POST /distributions/{contract}/{tokenId}/github-upload
API->>GitHub: create folder / upload files
GitHub-->>API: return upload result or error
API-->>Footer: return result or error
Footer->>Footer: store result/error, set isUploadingToGithub = false
Footer->>Modal: show modal with result or error
Modal->>User: display success (link, file lists) or error (retry)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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: 1
🤖 Fix all issues with AI agents
In
`@components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableSubscriptionFooter.tsx`:
- Around line 334-359: The Publish button's title (githubUploadTooltip) won't
show when the button is disabled; wrap the <button> in a focusable wrapper and
move the tooltip/title there so users can still see the reason when disabled.
Specifically, in the ReviewDistributionPlanTableSubscriptionFooter component,
wrap the existing <button> (which uses isUploadingToGithub, canPublishToGithub,
uploadToGithub) with a <div> or <span> that has title={githubUploadTooltip ??
undefined} and when the button is disabled add tabIndex={0} and
aria-disabled={true} on the wrapper so it remains focusable/accessible and
exposes the tooltip/description to assistive tech; keep the actual disabled
attribute on the button and do not change uploadToGithub, isUploadingToGithub,
or canPublishToGithub logic.
🧹 Nitpick comments (1)
components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableSubscriptionFooterGithubUploadModal.tsx (1)
90-111: Prefer stable keys for file lists.
Index keys can cause unnecessary re-renders if lists change between retries.♻️ Suggested tweak
- {result.deleted_files.map((f, i) => ( - <li key={i}>{f}</li> - ))} + {result.deleted_files.map((f) => ( + <li key={f}>{f}</li> + ))}- {result.uploaded_files.map((f, i) => ( - <li key={i}>{f}</li> - ))} + {result.uploaded_files.map((f) => ( + <li key={f}>{f}</li> + ))}
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableSubscriptionFooterGithubUploadModal.tsx`:
- Around line 75-92: The href is built directly from GITHUB_BASE and
result.github_folder which can contain spaces or reserved characters and break
the URL; update the Link generation (where result.github_folder and GITHUB_BASE
are used) to encode each path segment of result.github_folder before joining
(e.g. split on '/' and map each segment through encodeURIComponent then join
with '/'), then prepend GITHUB_BASE so the generated href is safe; keep the
existing conditional that checks result.github_folder.
🧹 Nitpick comments (1)
components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableSubscriptionFooter.tsx (1)
33-54: Make tooltip/gating loading-aware to avoid stale or misleading state.When
overviewis still loading (or still reflects the previous token), the current tooltip implies “Finalize…” andcanPublishcan be computed from stale data. Consider passingisLoadingOverviewinto the helpers to keep the button disabled and the tooltip accurate.♻️ Suggested refactor
-function getGithubUploadTooltip( - overview: DistributionOverview | null -): string | null { +function getGithubUploadTooltip( + overview: DistributionOverview | null, + isLoading: boolean +): string | null { + if (isLoading) { + return "Loading distribution overview…"; + } if (overview?.is_normalized === true) { if ((overview?.photos_count ?? 0) === 0) { return "Upload distribution photos first"; } if ((overview?.automatic_airdrops_count ?? 0) === 0) { return "Upload automatic airdrops first"; } return null; } return "Finalize and normalize the distribution first"; } -function canPublishToGithub(overview: DistributionOverview | null): boolean { +function canPublishToGithub( + overview: DistributionOverview | null, + isLoading: boolean +): boolean { + if (isLoading) return false; return ( overview?.is_normalized === true && (overview?.photos_count ?? 0) > 0 && (overview?.automatic_airdrops_count ?? 0) > 0 ); } -const githubUploadTooltip = getGithubUploadTooltip(overview); +const githubUploadTooltip = getGithubUploadTooltip( + overview, + isLoadingOverview +); - canPublish={canPublishToGithub(overview)} + canPublish={canPublishToGithub(overview, isLoadingOverview)}Also applies to: 331-332, 567-568
|



Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.