fix: list every discovered dev server on the phone, like the web

The web client's "running dev servers" list is machine-wide. The phone
filtered it to the current project's directory, which hid servers from
other checkouts (for example the telegram-antispam-bot server on 8080).
The empty state now shows the same set of ports that answered with a web
page, regardless of their project, and still hides the non-web ports the
web client puts behind "show hidden ports".

Version 0.7.2+702.
This commit is contained in:
blumia committed 2026-12-04 13:43:42 +08:00
1 parent 695d27cdd7
commit b372bce63f
4 files changed
+16 -10

No files matched your search

+5 -8
View File
@@ -181,16 +181,13 @@ class _BrowserPanelState extends State<BrowserPanel> {
try {
final list = await cl.devServers(directory: widget.directory);
if (!mounted) return;
final dir = slashPath(widget.directory);
// The web client's "running dev servers" list is machine-wide, not
// scoped to the open project, so show the same set here. Only ports
// that answered with a page (the web client hides the rest behind
// "show hidden ports") are listed.
final filtered = [
for (final server in list)
// A discovered port that answered with a page is a web dev server;
// adb/emulator/native ports with no page would only be noise.
if (server.title.isNotEmpty &&
(server.directory.isEmpty ||
slashPath(server.directory) == dir ||
isUnderDirectory(server.directory, dir)))
server,
if (server.title.isNotEmpty) server,
]..sort((a, b) => a.port.compareTo(b.port));
setState(() {
_servers = filtered;