diff --git a/.cursorrules b/.cursorrules index 8f2b4e0de..9b21dd3e3 100644 --- a/.cursorrules +++ b/.cursorrules @@ -1,7 +1,25 @@ # @dev Add cursor rules here. This goes in the LLM context window on every query when using cursor. +## Random + +- never open SVG files, it crashes you. Only read jpeg, png, gif, or webp. +- never run jq command, it crashes you. + +## Code quality + - Use explicit imports where possible - Make a best effort to keep code quality high. Reuse existing components and functions, dont hardcode hacky solutions. - When making changes, ensure you're not breaking existing functionality, and if there's a risk, explicitly WARN about it. - If you notice an opportunity to refactor or improve existing code, mention it. DO NOT make any changes you were not explicitly told to do. Only mention the potential change to the user. - Performance is important. Cache where possible, make sure to not make unnecessary re-renders or data fetching. +- Separate business logic from interface. This is important for readability, debugging and testability. + +## Testing + +- Where tests make sense, test new code. Especially with fast unit tests. +- tests should live where the code they test is, not in a separate folder + +## Documentation + +- document major changes in docs.md/CHANGELOG.md +- if you add any other documentation, the best place for it to live is usually docs/ diff --git a/.gitignore b/.gitignore index a7fc935b9..1bb7d213f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ docs/PR.md **.patch +PR.md + # dependencies /node_modules /.pnp diff --git a/WARP.md b/WARP.md new file mode 120000 index 000000000..161303b66 --- /dev/null +++ b/WARP.md @@ -0,0 +1 @@ +.cursorrules \ No newline at end of file diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md new file mode 100644 index 000000000..5fbb60c38 --- /dev/null +++ b/docs/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog + +All notable changes should be documented in this file. Be concise. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added +- **Points System V2** with tier-based progression (0-4 Tier) +- **QR Payment Perks** with tier-based eligibility and merchant promotions +- Hold-to-claim interaction for perks with progressive screen shake animation +- PWA haptic feedback that intensifies during perk claiming +- Activity feed perk indicators with yellow star icons and strikethrough amounts +- Transaction details "Peanut got you!" banner for claimed perks +- Dev tools page (`/dev/shake-test`) for testing animations and haptics + +### Changed +- QR payment flow now fetches payment locks in parallel with KYC checks for latency reduction +- Perk claiming uses optimistic UI updates for instant feedback (claim happens in background) +- Dev pages excluded from production builds for faster compile times +- Removed Points V1 legacy fields from `Account` and `IUserProfile` interfaces + +### Fixed +- BigInt type handling in points balance calculations (backend) +- Perk status now correctly reflects `PENDING_CLAIM` vs `CLAIMED` states in activity feed +- Modal focus outline artifacts on initial load +- `crypto.randomUUID` polyfill for older Node.js environments in SSR diff --git a/docs/consultant_feedback.md b/docs/consultant_feedback.md deleted file mode 100644 index b96e6f991..000000000 --- a/docs/consultant_feedback.md +++ /dev/null @@ -1,80 +0,0 @@ -Hello @hugomont I went through the code and try to answer as much as possible to your bullet points. I wasn't able to serve or build the app, it seems I'm missing some env variables, so I wasn't able to me more precise in my hypothesis. -If you want me to dig deeper into it, the best would be for me to discuss with your frontend dev directly, so we can work on specific issues & components. - -State management: -- Use URL search params when possible -- Use context for shared state -- Avoid props drilling when possible -- Try not to store objects in state -- I would not recommend using Redux, it's an old solution (pre-context) that most of the company try to get rid of - -Best practices with component: -- I would recommend to create more pages & subpages (with layout) -- Avoid creating component inside component (ex: GlobalLinkAccount has a renderComponent function) - -Slow compile times when developing locally: -- Some thought: too much code is executing on the server that shouldn't. -- Splitting the code and deps, lazy loading some chunks might reduce it. - -Large components that sometimes contain both ui and biz logic: -- For me it's not too big of an issue. Maybe we can go through some specific component and see how we can split it - -Low clientside load times, bad web vitals: -- Use as much as possible tree shakable libraries (ex: framer-motion -> import { m } instead of import { motion }) -- Dynamically import some libraries to lazy load them, I'm sure metamask-sdk has a heavy impact -- Try to remove libraries that you're using only a little (ex: axios, ethers) -- Use to lazy load libraries and content -- Prerender the pages (important) -- Use next caching -- Remove blocking CSS -- img: set width/height, set loading attribute -- Serve token logo from your server (public folder) -- Use to external resources -- Remove unused code & import, it might impact your bundle size for nothing - -State persistence across refresh: -- By using URL search params and subpages you'll get persistence by default -- For complexe data (list of items) store it in localstorage - -bruddle/style/color management: -- Try to stick to one component library (ex: chakra-ui-step is adding a bunch of config into CSS for one component) -- I would need to discuss with the frontend dev to better understand the problem and situation - -Bonus: -- Remove unused libraries (ex: sharp, react-lottie, i18next, ...) -- Do not put a