Skip to content

Commit

Permalink
Set max height for URL
Browse files Browse the repository at this point in the history
  • Loading branch information
kgpax committed Jan 6, 2024
1 parent a818453 commit d36029e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/afraid-turkeys-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@envyjs/webui': patch
---

Prevent long URLs from affecting visibility of trace details
2 changes: 1 addition & 1 deletion packages/webui/src/components/ui/TraceDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function TraceDetail() {
</div>
</div>

<div className="mb-4 break-all" data-test-id="url">
<div className="mb-4 break-all overflow-y-auto max-h-12" data-test-id="url">
{url}
</div>

Expand Down
51 changes: 51 additions & 0 deletions packages/webui/src/testing/mockTraces/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,56 @@ const inFlightEvent: Event = {
},
};

// REST request (super long URL)
const superLongUrlEvent: Event = {
id: 'TBC',
parentId: undefined,
serviceName: 'gql',
timestamp: elapseTime(1.2),
http: {
...requestData(
'GET',
'data.restserver.com',
443,
`/features?${new Array(500)
.fill(0)
.map((_, idx) => `query_variable_${idx + 1}=value_${idx + 1}`)
.join('&')}`,
),
state: HttpRequestState.Received,
requestHeaders: {
'accept': 'application/json',
'User-Agent': ['node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'],
'accept-encoding': 'br, gzip, deflate',
},
requestBody: undefined,
// ---------
httpVersion: '1.1',
statusCode: 200,
statusMessage: 'OK',
responseHeaders: {
'content-type': 'application/json; charset=utf-8',
'content-length': '351',
'date': 'Thu, 17 Mar 2022 19:51:00 GMT',
'vary': 'Origin',
'connection': 'close',
},
responseBody: JSON.stringify({
foo: 'bar',
}),
duration: 15,
timings: {
blocked: 1,
dns: 1,
connect: 5,
ssl: 2,
send: 3,
wait: 2,
receive: 3,
},
},
};

export default [
authRequest,
dataEvent,
Expand All @@ -330,4 +380,5 @@ export default [
errorEvent,
abortedEvent,
inFlightEvent,
superLongUrlEvent,
];

0 comments on commit d36029e

Please sign in to comment.