Skip to content

Commit e606b7e

Browse files
committed
wip
1 parent dd070a9 commit e606b7e

4 files changed

Lines changed: 11 additions & 210 deletions

File tree

packages/zpm-daemon-ui/packages/zpm-daemon-ui/src/generated/daemon-protocol.ts

Lines changed: 0 additions & 98 deletions
This file was deleted.

packages/zpm-daemon-ui/packages/zpm/src/daemon/protocol.generated.ts

Lines changed: 0 additions & 98 deletions
This file was deleted.

packages/zpm-daemon-ui/src/components/jobs-layout.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ function TaskRow({task, match, label, status, isActive, onRun, onStop, onSelect,
8686
const isRunning = status === `running`;
8787
const canRun = !(task.isLongLived && isRunning);
8888

89+
const prefixLen = task.workspace.length + 1;
90+
const adjustedRanges: Array<[number, number]> = [];
91+
for (const [start, end] of match?.ranges ?? []) {
92+
const s = Math.max(0, start - prefixLen);
93+
const e = Math.min(label.length, end - prefixLen);
94+
if (s < e) {
95+
adjustedRanges.push([s, e]);
96+
}
97+
}
98+
8999
return (
90100
<li>
91101
<div
@@ -95,7 +105,7 @@ function TaskRow({task, match, label, status, isActive, onRun, onStop, onSelect,
95105
>
96106
<span className={`inline-block h-1.5 w-1.5 flex-none rounded-full ${statusDotColor(status)}`} />
97107
<span className={`flex-1 truncate`}>
98-
<HighlightedText text={label} ranges={match?.ranges ?? []} />
108+
<HighlightedText text={label} ranges={adjustedRanges} />
99109
</span>
100110
{isRunning ? (
101111
<button

packages/zpm-daemon-ui/src/lib/daemon.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,6 @@ export function getAuthToken(): string | null {
7070
}
7171
}
7272

73-
/**
74-
* Persists a token in sessionStorage for the current tab.
75-
*/
76-
export function setAuthToken(token: string): void {
77-
try {
78-
sessionStorage.setItem(SESSION_STORAGE_TOKEN_KEY, token);
79-
} catch {
80-
// Ignore storage errors.
81-
}
82-
}
83-
8473
function buildConnectionUrl(base: string, token: string | null): string {
8574
if (!token)
8675
return base;
@@ -111,7 +100,6 @@ export class DaemonConnection {
111100
constructor(url: string, token: string | null) {
112101
this.url = url;
113102
this.token = token;
114-
console.log(`DaemonConnection constructor`, url, token);
115103
this.connect();
116104
}
117105

@@ -147,7 +135,6 @@ export class DaemonConnection {
147135
}
148136

149137
this.pendingRequests.clear();
150-
console.trace(`Closing socket`);
151138
this.socket?.close();
152139
this.socket = null;
153140
this.setState(`disconnected`);

0 commit comments

Comments
 (0)