akhaliq HF Staff commited on
Commit
9007f56
Β·
1 Parent(s): ede0c7c

update react app code

Browse files
Files changed (2) hide show
  1. anycoder_app/prompts.py +40 -1
  2. anycoder_app/ui.py +2 -1
anycoder_app/prompts.py CHANGED
@@ -279,6 +279,37 @@ CRITICAL Requirements:
279
  12. Follow accessibility best practices
280
  13. Configure next.config.js properly for HuggingFace Spaces deployment
281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  next.config.js Requirements:
283
  - Must be configured to work on any host (0.0.0.0)
284
  - Should not have hardcoded localhost references
@@ -312,7 +343,8 @@ FROM node:18-slim
312
 
313
  WORKDIR /app
314
 
315
- RUN apt-get update && apt-get install -y \
 
316
  curl \
317
  && rm -rf /var/lib/apt/lists/*
318
 
@@ -339,6 +371,13 @@ The user wants to apply changes based on their request.
339
  You MUST output ONLY the changes required using the following SEARCH/REPLACE block format. Do NOT output the entire file.
340
  Explain the changes briefly *before* the blocks if necessary, but the code changes THEMSELVES MUST be within the blocks.
341
 
 
 
 
 
 
 
 
342
  Format Rules:
343
  1. Start with <<<<<<< SEARCH
344
  2. Include the exact lines that need to be changed (with full context, at least 3 lines before and after)
 
279
  12. Follow accessibility best practices
280
  13. Configure next.config.js properly for HuggingFace Spaces deployment
281
 
282
+ 🚨 CRITICAL JSX SYNTAX RULES:
283
+ - Style objects and JSX props are SEPARATE - never mix them
284
+ - Style objects use camelCase property names and end with a closing brace
285
+ - Event handlers (onClick, onInput, onChange, etc.) are JSX props, NOT style properties
286
+ - Correct syntax:
287
+ ```jsx
288
+ <textarea
289
+ style={{
290
+ width: '100%',
291
+ padding: '12px',
292
+ height: '48px'
293
+ }}
294
+ onInput={(e) => {
295
+ // handler code
296
+ }}
297
+ placeholder="Type here"
298
+ />
299
+ ```
300
+ - WRONG syntax (DO NOT DO THIS):
301
+ ```jsx
302
+ <textarea
303
+ style={{
304
+ width: '100%',
305
+ height: '48px'
306
+ onInput={(e) => { // ❌ WRONG - onInput inside style object
307
+ ```
308
+ - Always ensure proper closing braces for style objects BEFORE adding event handlers
309
+ - Use proper indentation to keep JSX props at the same level
310
+ - PREFER Tailwind CSS classes over inline styles to avoid syntax errors
311
+ - If using inline styles, double-check closing braces before adding any event handlers
312
+
313
  next.config.js Requirements:
314
  - Must be configured to work on any host (0.0.0.0)
315
  - Should not have hardcoded localhost references
 
343
 
344
  WORKDIR /app
345
 
346
+ # Install system dependencies
347
+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
348
  curl \
349
  && rm -rf /var/lib/apt/lists/*
350
 
 
371
  You MUST output ONLY the changes required using the following SEARCH/REPLACE block format. Do NOT output the entire file.
372
  Explain the changes briefly *before* the blocks if necessary, but the code changes THEMSELVES MUST be within the blocks.
373
 
374
+ 🚨 CRITICAL JSX SYNTAX RULES:
375
+ - Style objects and JSX props must be SEPARATE - never mix them
376
+ - Event handlers (onClick, onInput, onChange) are JSX props, NOT style properties
377
+ - Always close style objects with }} BEFORE adding event handlers
378
+ - PREFER Tailwind CSS classes over inline styles
379
+ - Ensure all JSX is syntactically valid before outputting
380
+
381
  Format Rules:
382
  1. Start with <<<<<<< SEARCH
383
  2. Include the exact lines that need to be changed (with full context, at least 3 lines before and after)
anycoder_app/ui.py CHANGED
@@ -1117,7 +1117,8 @@ with gr.Blocks(
1117
 
1118
  WORKDIR /app
1119
 
1120
- RUN apt-get update && apt-get install -y \\
 
1121
  curl \\
1122
  && rm -rf /var/lib/apt/lists/*
1123
 
 
1117
 
1118
  WORKDIR /app
1119
 
1120
+ # Install system dependencies
1121
+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \\
1122
  curl \\
1123
  && rm -rf /var/lib/apt/lists/*
1124