Repository navigation
Custom entries in the Servers list: named URLs with paths, other hosts and per-worktree ports #31961
danielhusar
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What I'd like
Let a project add its own entries to the Servers list in thread details: a name and a URL, where the URL can take the port T3 detected and add a path, query string or a different host.
Why
The Servers list is useful, but it only shows what port discovery finds:
localhost:<port>and "Terminal · node". When I click a server I almost never want that bare address:/login?dev_user=true. That's the URL I open nearly every time, not/./cdn-cgi/local/explorer, or a demo page at/demo/....http://[::1]:<port>/demo/sandboxwhile the frame stays onlocalhost. The same applies to127.0.0.1or a*.localhostsubdomain.pnpm devstarts the app, the marketing site and an inspector port. The list shows each one as "Terminal · node", so I can't tell which is which.The port also isn't fixed. Several worktrees of the same repo run at once, so the dev script takes the next free port in each (5173, 5174, …). That's why a project action's Preview URL doesn't help: it's a fixed string, so it points at the wrong worktree's app.
A possible shape
A file checked into the repo (or the same thing in project settings), for example
.t3/servers.json:match.portwould mean "the first port at or above this one that belongs to this thread", so each worktree gets its own app with no changes to the file. Matching on the command line, or on the URL the server printed in the terminal, would work too.matchshows only while that server is running. An entry without one is always there.Another option: give the dev script a way to tell T3 its URLs while it runs, such as a
t3command or a file it writes. Then the script that picks the port also names the links.Related: #15238 (the sidebar doesn't show a thread's dev servers) and #4746 (the browser lists local servers awkwardly).
All reactions