Skip to content

chore: remove orphaned frontend/script.js and frontend/style.css files#233

Closed
adityashirsatrao007 wants to merge 2 commits into
imDarshanGK:mainfrom
adityashirsatrao007:cleanup/remove-orphaned-frontend-files
Closed

chore: remove orphaned frontend/script.js and frontend/style.css files#233
adityashirsatrao007 wants to merge 2 commits into
imDarshanGK:mainfrom
adityashirsatrao007:cleanup/remove-orphaned-frontend-files

Conversation

@adityashirsatrao007
Copy link
Copy Markdown

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- Removed frontend/script.js (530 lines, unreferenced)\n- Removed frontend/style.css (602 lines, unreferenced)\n\nCloses #232

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
Copilot AI review requested due to automatic review settings May 21, 2026 18:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 > 50000 and 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.

Comment thread frontend/index.html
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 thread frontend/index.html
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 thread frontend/index.html
Comment on lines +2281 to 2283
const LIMIT = 50000;
const WARN_AT = 45000;
charCount.textContent = val
@imDarshanGK imDarshanGK added invalid This doesn't seem right unassigned PR opened without issue assignment closed Closed due to assignment or outdated issue labels May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closed Closed due to assignment or outdated issue invalid This doesn't seem right unassigned PR opened without issue assignment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants