Skip to content
Source
Docs
Explore
Skills
MCP servers
For agents
Search or jump to…
Sign in
Sign up
pingdotgg
/
t3code
Pull requests
pingdotgg
t3code
Public
Synced with GitHub
Popular #1
Fork
0
0
0
0
1
2
3
4
5
6
7
8
9
Code
Architecture
Issues
Pull requests
Community
Assets
CI
Agents
Settings
fix(server): remote viewers can click and type in desktop-rendered preview tabs
#26815
Send to my agent
Closed
juliusmarminge
wants to merge 5 commits into
main
from
fix/issue-26796
·
opened
last month
View on GitHub
Conversation
8
Commits
5
Files changed
3
Impact
Showing
3 changed files
with
163 additions
and
12 deletions
.
x
0 of 3 viewed, 3 left
Files
Hide whitespace
Unified
Split
142 additions and 9 deletions
+142
-9
apps/server/src/preview/ServerBrowser.test.ts
Modified
Diff
Before/After
Viewed
apps/server/src/preview/ServerBrowser.test.ts
View file
Expand up
Show all 54 lines
@@ -55,8 +55,9 @@
55
55
return
makeEncoderPage
()
as
unknown
as
Page
;
56
56
}
57
57
async
connectDesktopPage
(endpoint:
string
) {
58
-
const
context =
makeContext
();
59
-
desktopConnections.
push
({ endpoint, context });
58
+
const
layout = { ...
DESKTOP_LAYOUT
};
59
+
const
context =
makeContext
(
undefined
, layout);
60
+
desktopConnections.
push
({ endpoint, context, layout });
60
61
return
{
browser
: {
close
:
async
() => {} },
page
: context.
page
as
unknown
as
Page
};
61
62
}
62
63
async
close
() {
Show all 20 lines
@@ -83,15 +84,25 @@
83
84
return
header.
toString
(
"base64"
);
84
85
})();
85
86
86
-
function
makeSession
(frame?:
ReturnType
<
typeof
makeFrame>) {
87
+
// The desktop's webview, sized by its panel rather than by viewport emulation.
88
+
const
DESKTOP_LAYOUT
= {
width
:
1024
,
height
:
640
};
89
+
90
+
function
makeSession
(frame?:
ReturnType
<
typeof
makeFrame>, layout?:
typeof
DESKTOP_LAYOUT
) {
87
91
const
events =
new
NodeEvents
.
EventEmitter
();
88
92
return
{
89
93
on
: vi.
fn
((name:
string
,
listener
: () =>
void
) => events.
on
(name, listener)),
90
-
emit
: (name:
string
) => events.
emit
(name),
94
+
emit
: (name:
string
, ...args:
unknown
[]) => events.
emit
(name, ...args),
91
95
detach
: vi.
fn
(
async
() => {}),
92
96
send
: vi.
fn
(
async
(method:
string
, input?:
unknown
):
Promise
<
Record
<
string
,
unknown
>> => {
93
97
if
(method ===
"Page.getNavigationHistory"
)
return
{
currentIndex
:
0
,
entries
: [{}] };
Home
Search
Explore
Menu