Skip to content

Commit f571723

Browse files
authored
Amazing UX Fixes! Prediction functionality all done! (#106)
1 parent d8ff8a3 commit f571723

File tree

60 files changed

+4716
-679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+4716
-679
lines changed

.cursor/rules/general-cursor-project-rule.mdc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ Validate all inputs and implement proper authentication
151151
### Database Migrations
152152
Use `pnpm run db:migrate:` commands where possible.
153153
Migration naming: Provide `--name descriptive_name` to avoid interactive prompts. Example `pnpm run db:migrate:dev --name add_user_table`
154+
Important: avoid using "prisma db push", prefer using "pnpm db:migrate:deploy:dev". This creates short term database migration inconsistencies that are difficult to debug. Prompt the user to explain your migration issue issue before trying db push.
154155

155156
### Next.js Build Best Practices
156157
Use `pnpm` not `npm`: Project uses pnpm for package management and build commands
@@ -170,6 +171,12 @@ Never make direct Prisma calls in components or API routes
170171
- Legacy REST endpoints removed (except cron jobs)
171172
- Type safety achieved end-to-end with Zod + tRPC
172173

174+
**Delta Calculation**: Delta represents the absolute difference between market probability and AI prediction probability:
175+
```
176+
delta = Math.abs(market.outcomePrices[0] - prediction.outcomesProbabilities[0])
177+
```
178+
This measures how much the AI prediction differs from current market sentiment.
179+
173180
### Security Best Practices
174181
Validate all user inputs
175182
Sanitize data before database operations
@@ -260,6 +267,7 @@ Code organization improvements
260267

261268

262269
## UI/UX Patterns
270+
Build UI for mobile friendly first. Then allow for different layouts for larger screens if convenient.
263271
Collapsible Content with Gradient Fade: For long text content that needs to be collapsed, use gradient fade effects to indicate there's more content below
264272
Show More/Less Controls: Use chevron icons (ChevronDown/ChevronUp) with descriptive text for expand/collapse actions
265273
Consistent Collapsed Heights: Match collapsed heights to related UI sections (e.g., prediction summary height)
@@ -271,6 +279,17 @@ Responsive: Tailwind spacing classes automatically scale appropriately on mobile
271279

272280
### Layout & Spacing Standards
273281
Refer to /lib/design-system.ts for instructions.
282+
Prefer flexbox layout instead of absolution positioning to ensure mobile first good UX.
283+
284+
### Input Layout Best Practices
285+
**Flex-based Search Inputs (RECOMMENDED)**: Use flexbox layout for search inputs with icons instead of absolute positioning:
286+
- Container: `flex items-center` with consistent styling
287+
- Left icon: `flex items-center justify-center pl-3` for natural positioning
288+
- Input field: `flex-1` to fill remaining space with transparent background
289+
- Right icon/button: `flex items-center justify-center pr-3` for natural right alignment
290+
- Advantages: Predictable layout, no z-index conflicts, better accessibility, responsive by default
291+
- Avoid: Absolute positioning which can cause CSS inheritance issues and layout conflicts
292+
- Pattern used by major web applications (Google, GitHub, etc.) for reliability
274293

275294

276295

CLAUDE.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# CLAUDE.md
2-
After completing each set of tasks - add in a positive motivational quote or advice in the style of the The Tao of Pooh and/or The Big Lebowski.
2+
After completing each set of tasks - add in a positive motivational Tao'ist, Socratic, or Cynical, or Stoic.
33

44

55
## Project Overview
@@ -146,6 +146,7 @@ Validate all inputs and implement proper authentication
146146
### Database Migrations
147147
Use `pnpm run db:migrate:` commands where possible.
148148
Migration naming: Provide `--name descriptive_name` to avoid interactive prompts. Example `pnpm run db:migrate:dev --name add_user_table`
149+
Important: avoid using "prisma db push", prefer using "pnpm db:migrate:deploy:dev". This creates short term database migration inconsistencies that are difficult to debug. Prompt the user to explain your migration issue issue before trying db push.
149150
150151
### Next.js Build Best Practices
151152
Use `pnpm` not `npm`: Project uses pnpm for package management and build commands
@@ -165,6 +166,12 @@ Never make direct Prisma calls in components or API routes
165166
- Legacy REST endpoints removed (except cron jobs)
166167
- Type safety achieved end-to-end with Zod + tRPC
167168
169+
**Delta Calculation**: Delta represents the absolute difference between market probability and AI prediction probability:
170+
```
171+
delta = Math.abs(market.outcomePrices[0] - prediction.outcomesProbabilities[0])
172+
```
173+
This measures how much the AI prediction differs from current market sentiment.
174+
168175
### Security Best Practices
169176
Validate all user inputs
170177
Sanitize data before database operations
@@ -255,6 +262,7 @@ Code organization improvements
255262
256263
257264
## UI/UX Patterns
265+
Build UI for mobile friendly first. Then allow for different layouts for larger screens if convenient.
258266
Collapsible Content with Gradient Fade: For long text content that needs to be collapsed, use gradient fade effects to indicate there's more content below
259267
Show More/Less Controls: Use chevron icons (ChevronDown/ChevronUp) with descriptive text for expand/collapse actions
260268
Consistent Collapsed Heights: Match collapsed heights to related UI sections (e.g., prediction summary height)
@@ -266,6 +274,7 @@ Responsive: Tailwind spacing classes automatically scale appropriately on mobile
266274
267275
### Layout & Spacing Standards
268276
Refer to /lib/design-system.ts for instructions.
277+
Prefer flexbox layout instead of absolution positioning to ensure mobile first good UX.
269278
270279
271280

0 commit comments

Comments
 (0)