Skip to content

test: cover drag upload language sync#738

Open
saurabhhhcodes wants to merge 3 commits into
imDarshanGK:mainfrom
saurabhhhcodes:test/drag-drop-language-regression-308
Open

test: cover drag upload language sync#738
saurabhhhcodes wants to merge 3 commits into
imDarshanGK:mainfrom
saurabhhhcodes:test/drag-drop-language-regression-308

Conversation

@saurabhhhcodes
Copy link
Copy Markdown
Contributor

Summary

  • add Playwright regression coverage for drag-and-drop uploads auto-selecting the detected language tab
  • update the static sample validator to run under the repo's ESM test package
  • correct the Python sample header so the existing sample-comment validator passes

Why

Issue #308 reports that dropped files could leave the active language tab stale. Current main already routes both file picker and drag/drop through handleUploadedFile, so this PR protects that behavior with a focused regression test and fixes the existing frontend static validator path.

Validation

  • npm run test:static passes from frontend/
  • git diff --check passes

Local limitation

  • Targeted Playwright run was attempted, but local execution is blocked by workstation backend setup: system python is absent, Python 3.9 cannot import the app because it needs 3.10+ union typing, and uv with Python 3.11 then stops on missing native libmagic. The GitHub runner has the project dependency stack and should be the source of truth for the E2E workflow.

Closes #308

@saurabhhhcodes saurabhhhcodes force-pushed the test/drag-drop-language-regression-308 branch from cdc97fd to a11ae20 Compare May 31, 2026 11:36
@saurabhhhcodes
Copy link
Copy Markdown
Contributor Author

Pushed a static-check repair follow-up after the first run failed in frontend/index.html validation.

What changed in the follow-up:

  • removed invalid label role/aria-label usage around the hidden file input
  • fixed result tab/tabpanel associations
  • changed language selector buttons to pressed-state controls instead of incomplete tabs
  • corrected heading order in the hero pills
  • replaced the spinner child div inside the analyze button with a span
  • normalized the Hindi sample text and removed validator-unfriendly void-element trailing slashes

Validation now passing locally:

  • npx --yes w3c-html-validator frontend/index.html
  • npm run test:static
  • git diff --check

@saurabhhhcodes
Copy link
Copy Markdown
Contributor Author

All checks are green now:

  • frontend static checks
  • Frontend Check
  • Lint
  • test (3.11)
  • test (3.12)
  • analyze

This PR closes assigned issue #308 and currently has no labels. If accepted for GSSoC, could you please add the relevant tracking labels such as gssoc:approved, level:beginner, type:bug, and type:frontend?

…ge-regression-308

# Conflicts:
#	frontend/index.html
@saurabhhhcodes
Copy link
Copy Markdown
Contributor Author

Refreshed this branch against current main and resolved the frontend/index.html conflict.

Conflict handled:

  • kept the main branch upload control as a button for valid semantics
  • preserved this PR’s static-check fix by keeping the file input outside the button and avoiding validator-unfriendly void-element syntax

Validation:

  • npx --yes w3c-html-validator frontend/index.html (pass)
  • npm run test:static from frontend (pass)
  • git diff --check

Notes:

  • full local pytest is blocked on this machine because only Python 3.9 is installed; the repo now uses 3.11+/3.12 syntax such as str | None and datetime.UTC
  • Playwright webServer is also blocked locally because its config calls python, which is not installed as a command here; GitHub CI is rerunning the 3.11/3.12 and frontend checks.

…uage-regression-308

# Conflicts:
#	frontend/index.html
@saurabhhhcodes
Copy link
Copy Markdown
Contributor Author

Refreshed the branch against latest main again and resolved the recurring frontend/index.html conflict. I kept the upload file input outside the button and preserved the validator-safe tab/language-control fixes from this PR.\n\nValidation after the refresh:\n- npx --yes w3c-html-validator index.html from frontend/\n- npm run test:static from frontend/\n- git diff --check HEAD~1..HEAD\n\nGitHub checks are rerunning on commit c09a842.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Drag-and-drop file uploads do not auto-select the detected language tab

2 participants