Skip to content

Integrated Campaigns Indexer#433

Merged
Ebube111 merged 2 commits intostagingfrom
campaign-indexer
Aug 1, 2025
Merged

Integrated Campaigns Indexer#433
Ebube111 merged 2 commits intostagingfrom
campaign-indexer

Conversation

@Ebube111
Copy link
Copy Markdown
Collaborator

@Ebube111 Ebube111 commented Aug 1, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a rich text editor for campaign descriptions with formatting options and character limits.
    • Added support for project name and description when creating campaigns.
    • Enhanced campaign creation to allow multi-step blockchain transactions for new projects.
    • Displayed fee recipient account IDs in donation summaries.
    • Added campaign settings for fee exemption and "Fees Avoidance Allowed".
    • Supported adding, updating, and removing funding sources and smart contracts in profile configuration.
    • Improved repository management with add, update, and remove capabilities.
  • Improvements

    • Migrated campaign data fetching to a new API indexer, updating campaign components to use enhanced data models and nested fields.
    • Updated campaign cards, banners, carousels, and lists to render HTML descriptions and improved date handling.
    • Enhanced loading states and error handling across campaign and profile pages.
    • Added version information display and ASCII banner in the app.
    • Improved conditional rendering and UI feedback for campaign actions and donation processing.
    • Updated campaign description character limit to 500.
  • Bug Fixes

    • Fixed rendering and overflow issues for long account names with improved tooltips.
    • Resolved conditional logic for referral fee bypass checkbox in donation confirmation.
  • Chores

    • Updated dependencies and package metadata, including new TipTap editor packages.
    • Added utility functions for timestamp conversion and HTML text truncation.
  • Refactor

    • Simplified and unified campaign and profile configuration logic for better maintainability and user experience.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 1, 2025

Caution

Review failed

Failed to post review comments.

Walkthrough

This update introduces a new campaign data model and API integration, refactors campaign-related UI components to use the new API, and adds a rich text editor for campaign descriptions. It also enhances profile configuration features, updates form handling, and improves campaign creation logic with richer project details and multi-transaction support. Several new utility functions and types are added.

Changes

Cohort / File(s) Change Summary
API Client & Config
src/common/api/indexer/internal/client.generated.ts, src/common/api/indexer/internal/config.ts, src/common/api/indexer/hooks.ts
Adds comprehensive campaign-related types, endpoints, and hooks for the new campaign API; introduces staging config.
Campaign Data Model & UI Refactor
src/entities/campaign/components/CampaignBanner.tsx, src/entities/campaign/components/CampaignCard.tsx, src/entities/campaign/components/CampaignCarouselItem.tsx, src/entities/campaign/components/CampaignProgressBar.tsx, src/entities/campaign/components/CampaignSettings.tsx, src/entities/campaign/components/CampaignsList.tsx, src/entities/campaign/components/editor.tsx, src/entities/campaign/hooks/forms.ts, src/entities/campaign/hooks/useCampaigns.ts, src/entities/campaign/models/schema.ts, src/pages/campaigns.tsx, src/pages/profile/[accountId]/campaigns.tsx
Refactors campaign components and hooks to use the new API, updates data access patterns, types, and UI logic, and supports new campaign features.
Rich Text Editor Integration
src/common/ui/form/components/richtext.tsx, src/common/ui/form/components/index.ts, package.json, src/entities/campaign/components/editor.tsx
Adds and integrates a TipTap-based rich text editor for campaign descriptions; updates dependencies and exports.
Campaign Creation Logic
src/common/contracts/core/campaigns/client.ts, src/common/contracts/core/campaigns/interfaces.ts
Refactors campaign creation to support multi-transaction flows for project details and adds new input fields.
Profile Configuration Enhancements
src/features/profile-configuration/components/AddFundingSourceModal.tsx, src/features/profile-configuration/components/contracts-section.tsx, src/features/profile-configuration/components/editor.tsx, src/features/profile-configuration/components/funding-sources.tsx, src/features/profile-configuration/components/repositories-section.tsx, src/features/profile-configuration/hooks/forms.ts
Refactors profile config UI and hooks to support add/remove/edit for funding sources, smart contracts, and repositories, removing modal-based editing for contracts.
Utilities & Constants
src/common/lib/datetime.ts, src/common/lib/string.ts, src/common/constants.ts
Adds date and HTML truncation utilities, exposes framework version in metadata, and logs a version banner.
Account Components Live Prop
src/entities/_shared/account/components/profile-images.tsx, src/entities/_shared/account/components/card.tsx
Adds a live prop to account profile image components and passes it from parent card component.
Donation Feature Updates
src/features/donation/components/modal-confirmation-screen.tsx, src/features/donation/components/summary.tsx
Refines fee bypass checkbox logic and adds recipient account links to fee summary.
General UI/UX Tweaks
src/entities/_shared/account/components/AccountProfileLink.tsx, src/pages/index.tsx
Improves account name overflow handling and adds skeleton loading for stats.
Wallet Integration (Commented Out)
src/common/blockchains/near-protocol/client.ts
Comments out Unity Wallet integration code.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CampaignEditor
    participant RichTextEditor
    participant APIClient
    participant Blockchain

    User->>CampaignEditor: Open/Create Campaign
    CampaignEditor->>APIClient: Fetch tokens, campaign data
    User->>RichTextEditor: Enter description (rich text)
    RichTextEditor-->>CampaignEditor: onChange (HTML)
    User->>CampaignEditor: Fill details, submit
    CampaignEditor->>APIClient: Validate, prepare data
    alt Project details required
        CampaignEditor->>Blockchain: callMultiple (profile, registry, create_campaign)
    else
        CampaignEditor->>Blockchain: create_campaign
    end
    Blockchain-->>CampaignEditor: Transaction result
    CampaignEditor-->>User: Navigate to campaign page
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~90 minutes

Possibly related PRs

  • #396: Both PRs filter out campaign ID 14 in CampaignsList, indicating a direct code-level connection.
  • #423: Both PRs introduce and integrate the rich text editor for campaign descriptions, sharing dependencies and UI changes.
  • #428: Both PRs refactor create_campaign to support multi-transaction flows and add project name/description fields.

Poem

A hop, a skip, a leap so grand,
Campaigns now richer across the land!
With fancy text and project flair,
Profile tweaks and forms that care.
API bunnies burrow deep—
New features blossom, reviews not cheap!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch campaign-indexer

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
potlock-next-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2025 9:40am

@Ebube111 Ebube111 changed the base branch from main to staging August 1, 2025 09:32
@Ebube111 Ebube111 merged commit 45e0701 into staging Aug 1, 2025
3 of 6 checks passed
This was referenced Aug 15, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Aug 27, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant