Skip to content

Commit 61bd835

Browse files
committed
added shortcuts in help and feedback
escaped "/" character in search for logs fixed cursor ordering
1 parent e079b96 commit 61bd835

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

apps/webapp/app/components/Shortcuts.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,37 @@ function ShortcutContent() {
161161
<ShortcutKey shortcut={{ key: "p" }} variant="medium/bright" />
162162
</Shortcut>
163163
</div>
164+
<div className="space-y-3">
165+
<Header3>Logs page</Header3>
166+
<Shortcut name="Filter by task">
167+
<ShortcutKey shortcut={{ key: "t" }} variant="medium/bright" />
168+
</Shortcut>
169+
<Shortcut name="Filter by run ID">
170+
<ShortcutKey shortcut={{ key: "i" }} variant="medium/bright" />
171+
</Shortcut>
172+
<Shortcut name="Filter by level">
173+
<ShortcutKey shortcut={{ key: "l" }} variant="medium/bright" />
174+
</Shortcut>
175+
<Shortcut name="Select log level">
176+
<ShortcutKey shortcut={{ key: "1" }} variant="medium/bright" />
177+
<Paragraph variant="small" className="ml-1.5">
178+
to
179+
</Paragraph>
180+
<ShortcutKey shortcut={{ key: "4" }} variant="medium/bright" />
181+
</Shortcut>
182+
<Shortcut name="Close detail panel">
183+
<ShortcutKey shortcut={{ key: "esc" }} variant="medium/bright" />
184+
</Shortcut>
185+
<Shortcut name="Details tab">
186+
<ShortcutKey shortcut={{ key: "d" }} variant="medium/bright" />
187+
</Shortcut>
188+
<Shortcut name="Run tab">
189+
<ShortcutKey shortcut={{ key: "r" }} variant="medium/bright" />
190+
</Shortcut>
191+
<Shortcut name="View full run">
192+
<ShortcutKey shortcut={{ key: "v" }} variant="medium/bright" />
193+
</Shortcut>
194+
</div>
164195
<div className="space-y-3">
165196
<Header3>Schedules page</Header3>
166197
<Shortcut name="New schedule">

apps/webapp/app/presenters/v3/LogsListPresenter.server.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ type ErrorAttributes = {
2727
[key: string]: unknown;
2828
};
2929

30+
function escapeClickHouseString(val: string): string {
31+
return val.replace(/\//g, "\\/");
32+
}
33+
34+
3035
export type LogsListOptions = {
3136
userId?: string;
3237
projectId: string;
@@ -294,11 +299,11 @@ export class LogsListPresenter extends BasePresenter {
294299

295300
// Case-insensitive search in message, attributes, and status fields
296301
if (search && search.trim() !== "") {
297-
const searchTerm = search.trim();
302+
const searchTerm = escapeClickHouseString(search.trim()).toLowerCase();
298303
queryBuilder.where(
299304
"(lower(message) like {searchPattern: String} OR lower(attributes_text) like {searchPattern: String})",
300305
{
301-
searchPattern: `%${searchTerm.toLowerCase()}%`
306+
searchPattern: `%${searchTerm}%`
302307
}
303308
);
304309
}
@@ -361,7 +366,7 @@ export class LogsListPresenter extends BasePresenter {
361366
const decodedCursor = cursor ? decodeCursor(cursor) : null;
362367
if (decodedCursor) {
363368
queryBuilder.where(
364-
"(environment_id, toUnixTimestamp(start_time), trace_id) > ({cursorEnvId: String}, {cursorUnixTimestamp: Int64}, {cursorTraceId: String})",
369+
"(environment_id, toUnixTimestamp(start_time), trace_id) < ({cursorEnvId: String}, {cursorUnixTimestamp: Int64}, {cursorTraceId: String})",
365370
{
366371
cursorEnvId: decodedCursor.environmentId,
367372
cursorUnixTimestamp: decodedCursor.unixTimestamp,

0 commit comments

Comments
 (0)