feat(fe): keep publications list and stats in sync via layout WebSocket and query tuning#37
Merged
SiegfriedBz merged 8 commits intoApr 26, 2026
Conversation
v0.4.0: FrontEnd polish, Foundry CI & Monorepo docs
Merge `develop` into `main`
Merge Develop into main ## Summary - Introduce standalone viem `PublicClient` instances with dedicated WebSocket (WSS) transports, independent of wagmi's wallet state, so event subscriptions are active for all page visitors — even without a connected wallet. - Added `useWatchNewPublicationStatusEvent` to use viem's `watchContractEvent` directly instead of wagmi's `useWatchContractEvent`, which only initializes chain clients when a wallet is connected to that specific chain. - Simplify the wagmi config to HTTP-only transports, since wallet-connected operations (transactions, signatures) don't need WebSocket. - Introduce a `byQueryParams` query-key factory so the publications cache is scoped per page and filter combination. - Debounce cache invalidation (3 s trailing window) to coalesce rapid-fire status transitions and account for CQRS eventual consistency.
Merge Develop into Main refactor: simplify submit publication (fixed stake, derived fee) ## Summary ### Contract - Simplify submitPublication by removing the _paidSubmissionFee parameter and deriving paidFee from msg.value - I_PUBLISHER_STAKE. - Replace previous fee/stake validation with a single minimum-payment check: msg.value >= I_PUBLISHER_STAKE + I_PUBLISHER_MIN_FEE. - Update all Foundry tests and helpers for the new function signature and revert behavior. ### Front End - Simplify the frontend submission UX by removing the user stake input entirely and turning the fee box into a read-only breakdown (fixed stake + estimated fee + total). - Regenerate the TS contract config to sync the ABI change. ### Deployments - [Base Sepolia](https://sepolia.basescan.org/address/0xf569d7b5016de6ef0f16fcae82d85d61249df31d#code) - [Ethereum Sepolia](https://sepolia.etherscan.io/address/0xfce6990d551a60f8640a498b6bc34a15822ba3e3#code)
Merge Develop into Main chore(docs): update READMEs
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes stale UI on
/publicationswhen users navigate between submit, list, and detail views, and when another wallet submits or status changes on-chain. Global metric cards now refresh together with the table.Problem
NewPublicationStatussubscriptions lived only on the list table, so leaving/publicationsdropped the WebSocket and missed events (e.g. submit redirect, spectator on detail).useGlobalStats(statsKeys.all) never refetched, so cards stayed stale while the table updated.Solution
PublicationsRealtimeProviderand wrap the publications layout souseWatchNewPublicationStatusEventruns for all /publications/* routes.usePublicationsso the list background-refetches on mount.NewPublicationStatuslogs, invalidateQueries forpublicationsKeys.allandstatsKeys.all.usePublicationDetailrefetchInterval from 5s to 10s while non-terminal.