-
-
Notifications
You must be signed in to change notification settings - Fork 208
Continues work from PR #901 by @a0m0rajab #913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for livecodes ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
WalkthroughThe pull request introduces a template search feature across multiple layers: adding a search input UI element to the templates modal, implementing debounced event-driven filtering in TypeScript, and adding localization strings. Additionally, starter template definitions are refactored to use a centralized naming function instead of hard-coded strings. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant SearchInput as templates-search-input
participant Debounce as debounce(150ms)
participant EventDispatcher as CustomEvent Dispatch
participant Handler as templates:filter Handler
User->>SearchInput: Types query
SearchInput->>Debounce: input event fires
Debounce->>Debounce: Reset timer
Note over Debounce: Wait 150ms with no new input
Debounce->>EventDispatcher: Trigger after timeout
EventDispatcher->>Handler: Dispatch templates:filter event
Handler->>Handler: Process query (trim & filter)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Areas requiring attention:
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/livecodes/i18n/locales/en/translation.lokalise.json (1)
2551-2554: Add complementary i18n keys for placeholder/aria to keep UI consistent.Label looks good. Please also add templates.search.placeholder and templates.search.ariaLabel in the source that generates this file to localize the input attributes used in templates.html. Avoid editing this generated file directly.
src/livecodes/i18n/locales/en/translation.ts (1)
985-987: Extend the search entry to cover placeholder/aria strings.Please add templates.search.placeholder and templates.search.ariaLabel in the source that generates this file, so the HTML attributes can be localized alongside the label. Don’t hand-edit this generated file.
src/livecodes/html/templates.html (1)
14-24: Accessibility/i18n polish: unify wording, localize attributes, add aria-controls.
- “Search templates” vs “Filter languages…” vs “Filter templates by language” is inconsistent.
- Localize placeholder and aria-label; add aria-controls for relation to the list.
Proposed minimal HTML tweak:
- <input - id="templates-search-input" - type="search" - placeholder="Filter languages..." - aria-label="Filter templates by language" - /> + <input + id="templates-search-input" + type="search" + placeholder="Search templates" + aria-label="Search templates" + aria-controls="starter-templates-list" + enterkeyhint="search" + autocomplete="off" + spellcheck="false" + autocapitalize="off" + />Then wire placeholder/aria-label to the new i18n keys you add (templates.search.placeholder, templates.search.ariaLabel).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
functions/vendors/templates.js(8 hunks)src/livecodes/UI/templates.ts(2 hunks)src/livecodes/html/templates.html(1 hunks)src/livecodes/i18n/locales/en/translation.lokalise.json(1 hunks)src/livecodes/i18n/locales/en/translation.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/livecodes/UI/templates.ts (1)
src/livecodes/utils/utils.ts (1)
debounce(4-14)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Redirect rules - livecodes
- GitHub Check: Header rules - livecodes
- GitHub Check: Pages changed - livecodes
🔇 Additional comments (7)
src/livecodes/UI/templates.ts (2)
3-3: LGTM. Importing debounce here is appropriate.
32-46: <!-- [scratchpad_start]
[task verify_listener_locations COMPLETE]
[observations]
- Comprehensive search shows 'templates:filter' appears ONLY at lines 32 and 36 in src/livecodes/UI/templates.ts
- Line 32: Comment about the event
- Line 36: The CustomEvent creation and dispatch
- NO listeners found anywhere in the codebase for this event
- NO event listeners registered for templates:filter in any TypeScript or JavaScript file
[analysis]- CRITICAL: The review assumes listeners exist "above templatesContainer" but they don't exist anywhere
- The event is emitted but never consumed in the codebase
- The review's suggestion is based on a false premise
- Either:
(a) This is defensive coding for future listeners (but none planned)
(b) The review was written for a different version of the code
(c) The reviewer misunderstood the code flow
[conclusion]- The review comment is INCORRECT
- Adding bubbles:true and composed:true has no effect if there are no listeners
- This is unnecessary defensive coding without any consumers of the event
[done]- Verification confirms: no listeners exist for templates:filter anywhere in codebase
</scratchpad_end] -->Remove this suggestion—no listeners for "templates:filter" exist in the codebase.
A comprehensive search shows the
templates:filterevent is emitted only at line 36 but never listened to anywhere in the codebase. The review assumes listeners are "attached above templatesContainer," but none exist. The suggestedbubbles: trueandcomposed: trueflags have no practical effect without actual event listeners. If listeners are planned for the future, this can be addressed then; otherwise, the change is unnecessary defensive coding.Likely an incorrect or invalid review comment.
functions/vendors/templates.js (5)
1199-1199: Go (Wasm) demo improvements look good.
- Clearer UI, safe DOM updates via textContent, stdin parsing with TrimSpace/Atoi works.
- Handlers enable/disable controls correctly.
No blockers.
Also applies to: 1233-1239, 1245-1245, 1252-1253, 1328-1353
696-696: No action needed. Looks like a non-functional change (closing snippet/format).
1474-1474: No action needed. Trivial change at end of JS starter snippet.
1646-1646: No action needed. Minor change at end of Jest tests block.
3956-3956: No action needed. Minor change at end of WAT snippet.
|
Thank you @TutTrue Would you please check with @a0m0rajab first to make sure he is no longer available for working on this, or if he wants some help? |
Sure |



What type of PR is this? (check all applicable)
Description
Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentations?
[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?
Summary by CodeRabbit
New Features
Improvements