Skip to content

Fix/debug tripsitter app#10

Open
12Matt3r wants to merge 7 commits intoreddit:mainfrom
12Matt3r:fix/debug-tripsitter-app
Open

Fix/debug tripsitter app#10
12Matt3r wants to merge 7 commits intoreddit:mainfrom
12Matt3r:fix/debug-tripsitter-app

Conversation

@12Matt3r
Copy link

Closes #

💸 TL;DR

📜 Details

Design Doc

Jira

🧪 Testing Steps / Validation

✅ Checks

  • CI tests (if present) are passing
  • Adheres to code style for repo
  • Contributor License Agreement (CLA) completed if not a Reddit employee

1.  Corrected a syntax error in a `catch` block within the `evolveCurrentShader` function that was missing curly braces, which would cause the entire script to fail.
2.  Fixed a bug in the GLSL vertex shader (`vsSource`) where the texture coordinate varying (`v_texCoord`) was being assigned to itself instead of the texture coordinate attribute (`a_texCoord`), which would have caused incorrect rendering.
This commit addresses several issues in the `index.html` file to improve stability and remove unused code, following user instructions.

Fixes:
- Corrected a syntax error in a `catch` block within the `evolveCurrentShader` function. The original code was missing curly braces, which would cause the script to fail.
- Fixed a bug in the GLSL vertex shader (`vsSource`) where the `v_texCoord` varying was incorrectly assigned to itself instead of the `a_texCoord` attribute. This ensures texture coordinates are correctly passed to the fragment shader, fixing a major rendering issue.

Trimming:
- Removed an unused `<input>` element with the ID `aiPromptInput` from the "AI Coach" tab, as it had no corresponding JavaScript functionality.
This commit addresses several issues and adds new functionality as requested:

- Fixed a critical JavaScript syntax error (missing braces in a catch block) that prevented the script from running.
- Fixed a GLSL typo in the vertex shader (`v_texCoord = v_texCoord;` to `v_texCoord = a_texCoord;`) that caused rendering issues.
- Removed an unused HTML element (`aiPromptInput`).
- Implemented graceful error handling for AI-generated shaders. If a new shader fails to compile, the application will revert to the previous working shader instead of crashing.
- Added accessibility improvements, including `aria-label` attributes for icon-only buttons and `:focus-visible` styles for better keyboard navigation.
- Improved performance by debouncing slider and number input controls to reduce the frequency of WebGL uniform updates.
- Optimized memory usage by dynamically allocating and deallocating the WebGL history buffer textures based on the user's selection, instead of always allocating the maximum size.
This commit addresses a bug in the AI Shader Lab and implements several user-requested enhancements.

- Fixes a bug where generating a shader with an empty prompt would cause an error. The application now sends a randomized prompt to the AI instead.
- Adds graceful error handling for AI-generated shaders. If a new shader fails to compile, the application shows an error but keeps the previous, working shader active.
- Improves accessibility by adding `aria-label` attributes to icon-only buttons and `:focus-visible` styles for better keyboard navigation.
- Enhances performance by debouncing slider and number input controls to reduce the frequency of WebGL uniform updates.
- Optimizes memory usage by dynamically allocating and deallocating the WebGL history buffer textures based on the user's selection, preventing unnecessary GPU memory consumption.
- Fixes a potential null-pointer exception by adding a check before accessing the spinner's style property in the `finally` block of `generateNewShaderFromPrompt`.
This commit addresses several issues and adds new functionality as requested:

- Fixes a bug where generating a shader with an empty prompt would cause an error. The application now sends a randomized prompt to the AI instead.
- Adds graceful error handling for AI-generated shaders. If a new shader fails to compile, the application shows an error but keeps the previous, working shader active.
- Improves accessibility by adding `aria-label` attributes to icon-only buttons and `:focus-visible` styles for better keyboard navigation.
- Enhances performance by debouncing slider and number input controls to reduce the frequency of WebGL uniform updates.
- Optimizes memory usage by dynamically allocating and deallocating the WebGL history buffer textures based on the user's selection, preventing unnecessary GPU memory consumption.
- Fixes a potential null-pointer exception by adding a check before accessing the spinner's style property in the `finally` block of `generateNewShaderFromPrompt`.
This commit replaces the repository's previous content with the complete TripSitter AI project. It includes the final `index.html` application and a new, detailed `README.md`.

The application code incorporates all previously developed fixes and features:
- Corrected critical JavaScript and GLSL rendering bugs.
- Enhanced performance with debounced UI controls.
- Optimized GPU memory by dynamically resizing the WebGL history buffer.
- Improved accessibility with ARIA labels and focus indicators.
- Made AI features more robust with graceful error handling for shader compilation.
- Upgraded the Shader Lab to allow direct pasting and compiling of raw GLSL code.
- Added a comprehensive README explaining features, setup, and usage.
This commit cleans the repository and adds the complete, self-contained TripSitter AI project.

This single `index.html` file includes all previously implemented bug fixes, performance enhancements, accessibility improvements, and new features.

- **Bug Fixes:** Corrected critical GLSL and JavaScript errors.
- **Improvements:**
  - Debounced UI controls for better performance.
  - Optimized GPU memory with a dynamic history buffer.
  - Added ARIA labels and focus styles for accessibility.
  - Implemented graceful error handling for AI features.
- **New Features:**
  - Added the ability to paste raw GLSL code into the Shader Lab.
  - Added a comprehensive `README.md` file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant