Skip to content

Prompt padding accuracy#1

Closed
ben-million wants to merge 1 commit intomainfrom
cursor/prompt-padding-accuracy-2d77
Closed

Prompt padding accuracy#1
ben-million wants to merge 1 commit intomainfrom
cursor/prompt-padding-accuracy-2d77

Conversation

@ben-million
Copy link
Collaborator

Overhauls padding prompt output to generate targeted, near-diff instructions, making them actionable for less capable LLMs.

This PR introduces a 3-tier system (Tailwind, CSS Rule, Fallback) for padding modifications, collecting real signals like React fiber source location, Tailwind class names, and authored CSS declarations to produce concrete find/replace suggestions instead of abstract descriptions.


Open in Web Open in Cursor 

…e signals

- Create utils/react-fiber.ts: walk React fiber for component name, source file, line number
- Create utils/tailwind.ts: parse Tailwind padding classes, spacing scale, compute new classes
- Create utils/css-rules.ts: walk matched stylesheets for authored padding declarations
- Extend Modification type with original 4-side padding, fullClassName, tailwind/css signals
- Collect all signals at pick-time in tweaker.tsx (fiber, className, Tailwind, CSS rules)
- Rewrite prompt.ts padding section with 3-tier system:
  Tier 1: Tailwind className find/replace diff
  Tier 2: CSS rule declaration find/replace
  Tier 3: Per-side before/after fallback with px values
- Add getElementClassName to dom.ts (handles SVG elements)

Co-authored-by: Ben MacLaurin <ben-million@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Mar 8, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@ben-million ben-million closed this Mar 8, 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.

2 participants