Skip to content

feat(plugins): add plugin architecture#207

Open
paolomolo wants to merge 289 commits intodevelopfrom
feat/feed-plugin-architecture
Open

feat(plugins): add plugin architecture#207
paolomolo wants to merge 289 commits intodevelopfrom
feat/feed-plugin-architecture

Conversation

@paolomolo
Copy link
Copy Markdown
Contributor

@paolomolo paolomolo commented Oct 22, 2025

Note

Introduce a plugin architecture for the social feed (with poll and token plugins), add poll composer attachments and dynamic routes, and replace legacy governance UI with on-chain poll flow.

  • Plugin Architecture:
    • Add plugin-sdk, host context (PluginHostProvider), registries (composer, attachments, item-actions, routes, modals, menu), and loaders for local/external plugins.
    • Dynamic routes via getRoutes(); plugin-provided routes/nav integrated.
  • Feed & Rendering:
    • Introduce unified feed entry model and FeedRenderer/FeedOrchestrator to merge plugin entries.
    • Register built-in plugins: poll-created and token-created with renderers and translations.
  • Polls (On‑chain):
    • Add poll composer attachment (poll-attachment) with length controls and validation; inline pending/ready rendering.
    • New PollDetail view and PollCreatedCard UI; voting/revoke flows using SDK + governance API.
    • Cache/emit events to inject entries and reconcile pending polls.
  • Governance API:
    • Extend src/api/governance.ts with /api/governance/votes DTOs and client methods; adapt consumers to new responses.
  • UI/Navigation:
    • Update headers/navigation to memoize items and include plugin nav; remove legacy governance views/components/routes; add poll route poll/:pollAddress.
  • Post Composer:
    • Integrate attachments/tooling and plugin composer actions; conditional GIF vs. poll; improved focus/auto-grow.
  • Misc:
    • CONFIG gains PLUGINS/PLUGIN_CAPABILITIES_ALLOWLIST; enable composer-attachments feature flag.
    • Improve BlockchainInfoPopover time resolution/label; minor i18n additions and DEX labels.
    • Vite server/test tweaks, new styles for feed plugin cards.

Written by Cursor Bugbot for commit 3df75ee. This will update automatically on new commits. Configure here.

@netlify
Copy link
Copy Markdown

netlify bot commented Oct 22, 2025

Deploy Preview for fancy-gelato-7cdad5 ready!

Name Link
🔨 Latest commit 2751729
🔍 Latest deploy log https://app.netlify.com/projects/fancy-gelato-7cdad5/deploys/6920cd5810b6290008ff1c44
😎 Deploy Preview https://deploy-preview-207--fancy-gelato-7cdad5.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

cursor[bot]

This comment was marked as outdated.

@cursor
Copy link
Copy Markdown

cursor bot commented Oct 23, 2025

Bug: Memo Hook Missing Chain Height Dependency

The combinedList useMemo relies on chainHeight to calculate poll creation timestamps. Since chainHeight is not in the dependency array, poll entries may display stale or incorrect creation times when the chain height updates.

Fix in Cursor Fix in Web

@cursor
Copy link
Copy Markdown

cursor bot commented Oct 23, 2025

Bug: Component Mismatch Causes Undefined Balance

The DelegationSettings component destructures balance from useAccount, but the hook returns decimalBalance. This leaves balance undefined, leading to an incorrect or broken voting power display.

Fix in Cursor Fix in Web

@cursor
Copy link
Copy Markdown

cursor bot commented Oct 23, 2025

Bug: Memo Hook Missing Chain Height Dependency

The combinedList useMemo hook uses chainHeight to calculate poll creation timestamps, but chainHeight is missing from its dependency array. This prevents the list from updating when the chain height changes, resulting in stale poll timestamps.

Fix in Cursor Fix in Web

@cursor
Copy link
Copy Markdown

cursor bot commented Oct 23, 2025

Bug: Poll End Date Defaults Incorrectly

The endDate calculation in useGovernance incorrectly sets a poll's end date to the current time when others.closeHeight is null or undefined. This occurs because ((others.closeHeight ?? height) - height) evaluates to 0, causing polls without a defined closeHeight to appear as ending immediately.

Fix in Cursor Fix in Web

@cursor
Copy link
Copy Markdown

cursor bot commented Oct 23, 2025

Bug: Routing Mismatch Causes Unnecessary Redirects

The application's routing for governance poll detail pages is inconsistent. While the canonical route is now /voting/poll/:id, components like FeedList and GovernancePolls still generate links using the deprecated /voting/p/:id path. This leads to unnecessary redirects and a minor mismatch in how the poll address parameter is referenced.

Additional Locations (2)

Fix in Cursor Fix in Web

@cursor
Copy link
Copy Markdown

cursor bot commented Oct 23, 2025

Bug: Incorrect Destructuring in useAccount() Hook

The useAccount() hook is incorrectly destructured for balance and activeAccount. useAccount() provides decimalBalance (not balance), and activeAccount is typically from useAeSdk(). This causes balance to be undefined, breaking the voting power display at line 62.

Fix in Cursor Fix in Web

@cursor
Copy link
Copy Markdown

cursor bot commented Oct 23, 2025

Bug: Plugin Queries Incorrect Network for Poll Creation

The poll-created plugin hardcodes the middleware URL to ae_uat when fetching poll creation times. This causes the plugin to query the wrong network if the active network differs, leading to incorrect or missing poll creation time data.

Fix in Cursor Fix in Web

@cursor
Copy link
Copy Markdown

cursor bot commented Oct 23, 2025

Bug: Polls Expire Immediately When closeHeight Is Null

The endDate calculation now uses ((others.closeHeight ?? height) - height). If closeHeight is null or undefined, this expression evaluates to 0, setting the endDate to the current time. This makes such polls appear to expire immediately, differing from the prior behavior where null - height would result in an invalid endDate.

Fix in Cursor Fix in Web

@cursor
Copy link
Copy Markdown

cursor bot commented Oct 23, 2025

Bug: Invalid Poll ID Renders Blank Screen

The GovernanceVote component now returns null when pollAddress is invalid, rather than throwing an error. This causes the component to render nothing, and the parent component doesn't handle this null return. As a result, users see a blank screen with no feedback when navigating to an invalid poll ID.

Fix in Cursor Fix in Web

Light bg, stronger bar gradient, border tint, and micro-press transform
…g state

Refetch overview to update counts; disable double-submits; display 'Pending…'
Track pendingOption; render 'Pending…' for that option only
Pending appears only on selected option; mobile shows Spinner only
Show spinner at all breakpoints to match tipping button behavior
Revoke previous vote before casting new one; refresh overview and my vote
Set myVote immediately for better feedback; still refetch overview afterward
Submit contract event and delay refreshMyVote to prevent jump back
Adjust local counts immediately while tx pending; reconcile after refetch
Keep requested vote while backend catches up; reconcile after lock expires
Move optimistic changes to post-vote/revoke resolve; keep immediate reconcile afterwards
cursor[bot]

This comment was marked as outdated.

Add PollDetail view rendering PollCreatedCard with voting actions

Add /poll/:pollAddress route under SocialLayout

Update feed click to open /poll and preload PollDetail chunk

Update feed plugin guide with detail pages section

Keep legacy /voting redirects; stop linking to old voting detail
…p in detail

Save feed scrollY before navigating to /poll/:id

Ensure PollDetail scrolls to top on mount
…tions

Make PollCreatedCard clickable at container level

Stop propagation for internal interactive elements (vote, retract, links)
Remove onOpen in PollDetail so container click does not navigate
Fetch creation tx hash from MDW and pass to PollCreatedCard

Keeps UI consistent with feed poll card badge
Pass metadata.description through plugin adapter and render in PollCreatedCard

Wire description into PollDetail as body text under title
Move time-left next to vote count and add SharePopover with /poll/:id

Relax SharePopover to support urlOverride without postId
- Add Feed Plugins & Popular Feed Injection guide

- Add API Plugin Development guide for backend plugins

- Document popular feed integration for both frontend and backend

- Update Plugin SDK documentation with feed plugins and API plugin sections

- Update integration guide with references to new plugin guides

- Add new guides to navigation in mint.json
- Remove outdated 'Pages in this tutorial' section from index

- Create dedicated References page with comprehensive resources

- Add Superhero Wallet download links (Chrome, Firefox, Android, iOS, Web)

- Add testnet faucet link with tip

- Add block explorers and development endpoints

- Update forum link to general æforum homepage

- Shorten Feed Plugins page title

- Add References page to navigation
- Split 'Build' group into 'Contract Development' and 'Plugin Development'

- Contract Development: scaffold, contracts, test-and-deploy

- Plugin Development: integration, feed plugins, API plugins
- Rename 'Operations & Support' to 'Hints & Tips' with expanded content

- Add plugin development tips and troubleshooting

- Group Hints and References under 'Resources' section

- Remove 'Official' from References title

- Rename index page from 'Overview' to 'Build Superhero Plugins'

- Replace 'Extensions' with 'Plugins' throughout index page

- Shorten sidebar title and remove duplicate heading
- Split setup page into: Prerequisites, Wallet Setup, Configure Cursor, Project Setup

- Add Setup Overview page with links to all setup steps

- Add Superhero Docs MCP server configuration instructions

- Update navigation to include all new setup pages
- Fix all broken links pointing to archived pages

- Update quickstart.md to use current page structure

- Update overview.md, README.md, SUMMARY.md with current structure

- Replace 'extension' terminology with 'plugin' throughout

- Add 'Next Steps' sections to all major pages for better navigation

- Improve cross-linking between related documentation pages

- Add MCP tip to hints page for AI-assisted development

- Update directory paths (src/extensions -> src/plugins)

- Add quick links section to main index page
…info

- Reorganize page to prioritize production MCP URL (docs.superhero.com)

- Add 'Alternative: Run Documentation Locally' section

- Add info about accessing raw Markdown files via .md URL extension

- Improve page structure with clearer steps and better organization

- Add tip about Markdown format and AI agent accessibility
- Add prominent MCP configuration tip at the top

- Add Configure Cursor step to setup instructions

- Add time estimates for each step (more realistic)

- Improve step descriptions with specific commands

- Add tip about MCP helping with iteration and debugging

- Remove time estimate from warning box

- Improve Next Steps section
- Update quickstart prompt to include backend plugin development

- Add workspace setup step (step 0) to prompt

- Create backend-setup.md page with complete backend API setup instructions

- Add workspace configuration for multi-repo development

- Improve project setup with all-in-one script

- Update repository descriptions (remove 'repo', clarify UI/API)

- Remove warning boxes, convert to regular text

- Fix documentation inconsistencies and broken links

- Update index.md and README.md to reflect three-repo structure
- Remove 'optional' from backend API repository description

- Clarify backend API is for transaction processing and popular feed

- Update prompt step 3 to emphasize transaction processing first

- Improve backend plugin workflow description
@paolomolo paolomolo changed the title WIP: Feat/plugin-architecture WIP: feat(plugins) add plugin architecture Nov 21, 2025
@paolomolo paolomolo changed the title WIP: feat(plugins) add plugin architecture WIP: feat(plugin) add plugin architecture Nov 21, 2025
@paolomolo paolomolo changed the title WIP: feat(plugin) add plugin architecture WIP: feat(plugins): add plugin architecture Nov 21, 2025
- Add GitHub Actions workflow for deploying Mintlify docs to GitHub Pages

- Update LOCAL_SETUP.md with GitHub Pages deployment instructions

- Add .nojekyll file for GitHub Pages compatibility

- Fix broken plugin-sdk.md links (use ../../ instead of ../)

- Remove .md extensions from all internal markdown links

- Update link checker script to handle links without extensions
- Revert Vite dev server port to 5173 (matches netlify.toml)

- Change Mintlify docs server port from 3001 to 3002

- Backend API remains on port 3000

- All services can now run simultaneously without conflicts
- Rename docs/LOCAL_SETUP.md to docs/README.md

- Add link to docs.superhero.com at the top

- Rename 'Local Development' section to 'Run Documentation Locally'

- Improve structure with Documentation Structure and Contributing sections

- Update script reference from LOCAL_SETUP.md to README.md
- Remove docs/tutorials/hackathon/overview.md

- Update README.md and SUMMARY.md to link to ../../index instead of ./overview

- Consolidate documentation entry point to root index.md
- Remove cache: 'npm' from Node.js setup step

- Cache is not needed for global npm installs (Mintlify CLI)

- Prevents potential cache-related errors in GitHub Actions
…intlify

feat(docs): replace mkdocs with AI-accessible mintlify docs
- Add leaderboard navigation item to trending section

- Add tokenHolderLabel prop and rendering to ReplyToFeedItem component

- Resolves merge conflicts preventing Netlify deployment
- Resolve conflicts in navigationItems.ts (keep plugin support)

- Resolve conflicts in ReplyToFeedItem.tsx (keep InlinePoll and CONFIG imports)

- Integrate leaderboard feature from develop

- Merge all other changes from develop branch
- Remove incorrect comment stating Mintlify doesn't generate local artifacts

- Add .mintlify/ and docs/.mintlify/ to gitignore

- Prevents accidental commit of build artifacts from 'mintlify build' command
@paolomolo paolomolo changed the title WIP: feat(plugins): add plugin architecture feat(plugins): add plugin architecture Nov 21, 2025
- Resolve merge conflict in function signature

- Fixes Netlify build failure caused by conflict markers
@paolomolo
Copy link
Copy Markdown
Contributor Author

@Andreea167 pls retest

@Andreea167
Copy link
Copy Markdown

Andreea167 commented Nov 24, 2025

@paolomolo

  1. the vote is not showing at all now - https://deploy-preview-207--fancy-gelato-7cdad5.netlify.app/poll/ct_2gPKLt4WiJ95PQJbVAquHyLVheEyjH2Z9gbZ21fTv3fopFkL4z - I voted and for a second shows 100%, and then reset to 0% and I'm able to click for voting again (please see video)

  2. Besides that, if you want to click on the pool to go to "detail post view" from feed -> popular -> you get an error for loading post since the url is ....post/poll:124
    if you navigate to detail post view from feed -> latest -> you can view the post correctly since the url inlclude the contract address

Screen.Recording.2025-11-24.at.11.41.40.mov

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.

2 participants