chore: remove orphaned frontend/script.js and frontend/style.css files#233
Closed
adityashirsatrao007 wants to merge 2 commits into
Closed
Conversation
The API rejects code over 50,000 characters but the editor gave no warning until request failure. Changes: - Added visual warning at 45K chars (yellow) and error state at 50K (red) - Added inline warning text showing remaining chars or truncation notice - Added pre-submit check in doAnalyze() that blocks oversized submissions - Added CSS for warning and error states on charCount Closes imDarshanGK#179
Contributor
There was a problem hiding this comment.
Pull request overview
Removes dead frontend assets that are not referenced by the self-contained frontend/index.html, reducing confusion and repository size. This PR also adds UI/validation logic in index.html to warn/block analyses when pasted code approaches/exceeds the backend’s 50k character limit.
Changes:
- Deleted unreferenced
frontend/style.css. - Deleted unreferenced
frontend/script.js. - Added character-count warning styling + a 50k character limit check in
frontend/index.html.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| frontend/style.css | Removed orphaned stylesheet that is not loaded by the frontend. |
| frontend/script.js | Removed orphaned script that is not loaded by the frontend. |
| frontend/index.html | Adds char-count warning UI and enforces a 50k character submission limit. |
Comments suppressed due to low confidence (1)
frontend/index.html:2299
- The warning text says the code "will be truncated on submit", but the current submit path (doAnalyze) returns early when
code.length > 50000and the backend validator rejects >50k as well. Update the message to reflect that analysis is blocked, or implement actual truncation before submit so the UI message matches behavior.
const warnEl = document.getElementById('charWarning');
if (warnEl) {
if (chars > LIMIT) {
warnEl.textContent = 'Code exceeds 50K limit — will be truncated on submit';
warnEl.style.color = '#dc2626';
} else if (chars > WARN_AT) {
const remaining = (LIMIT - chars).toLocaleString();
warnEl.textContent = 'Approaching 50K limit (' + remaining + ' chars remaining)';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const code = editor.value.trim(); | ||
| if (!code) { toast('Please paste some code first.', 'error'); return; } | ||
| if (code.length > 50000) { | ||
| toast('Code exceeds 50,000 character limit and will be truncated.', 'error'); |
Comment on lines
+2281
to
+2286
| const LIMIT = 50000; | ||
| const WARN_AT = 45000; | ||
| charCount.textContent = val | ||
| ? chars.toLocaleString() + ' chars · ' + lines + ' lines · ' + nonBlank + ' non-blank' | ||
| : 'Paste or type code to begin'; | ||
| charCount.className = ''; |
Comment on lines
+2281
to
2283
| const LIMIT = 50000; | ||
| const WARN_AT = 45000; | ||
| charCount.textContent = val |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description\n\nThese two files are never loaded by
frontend/index.html(which uses inline<style>and<script>). They are completely dead code.\n\n## Changes\n- Removedfrontend/script.js(530 lines, unreferenced)\n- Removedfrontend/style.css(602 lines, unreferenced)\n\nCloses #232