Files
MagMueller 4573b5222f fix(browser): drop handleFileChooser call and async handler registration
Pyright / code-style CI on PR #4681 flagged two issues, both real and
from this patch:

1. Page.handleFileChooser isn't exposed by cdp_use's PageClient, so the
   attribute access fails type checking. It isn't needed either:
   per CDP spec, Page.setInterceptFileChooserDialog(true) alone causes
   Chromium to suppress the native dialog ("native file chooser dialog
   is not shown"). The page simply sees no file selected, which is the
   desired behavior when no upload is in flight.
2. The Page.fileChooserOpened callback signature is sync
   (FileChooserOpenedEvent, Optional[str]) -> None, not async.

Simplify the patch to the minimum required: just enable interception.
The protection is unchanged — Chromium still blocks the modal dialog
that would wedge the renderer. Drop the custom handler entirely since
the interception flag itself delivers the fix and no downstream logic
needs a synthesized cancel.
2026-04-14 18:19:51 -07:00
..
2025-08-26 14:23:40 -07:00
2025-09-19 19:36:53 -07:00
2026-03-21 02:05:42 -04:00
2026-03-21 02:05:42 -04:00
2025-09-23 20:03:26 -07:00
…
…

Codebase Structure

The code structure inspired by https://github.com/Netflix/dispatch.

Very good structure on how to make a scalable codebase is also in this repo.

Just a brief document about how we should structure our backend codebase.

Code Structure

src/
/<service name>/
models.py
services.py
prompts.py
views.py
utils.py
routers.py

    	/_<subservice name>/

Service.py

Always a single file, except if it becomes too long - more than ~500 lines, split it into _subservices

Views.py

Always split the views into two parts

# All
...

# Requests
...

# Responses
...

If too long → split into multiple files

Prompts.py

Single file; if too long → split into multiple files (one prompt per file or so)

Routers.py

Never split into more than one file