diff --git a/src/features/project-workspace/ProjectWorkspacePage.tsx b/src/features/project-workspace/ProjectWorkspacePage.tsx
index ae64ffa..30d3604 100644
--- a/src/features/project-workspace/ProjectWorkspacePage.tsx
+++ b/src/features/project-workspace/ProjectWorkspacePage.tsx
@@ -78,7 +78,7 @@ function WorkspaceBody() {
selected={selectedSpec}
setSelected={setSelectedSpec}
/>
-
+
);
}
@@ -139,11 +139,12 @@ function RequestsSpecsList(props: {
};
return (
-
+
{specs.map((spec) => (
- setHovered(spec.uuid)}
onMouseLeave={() => setHovered(null)}
onClick={handleSpecClickFn(spec)}
@@ -153,9 +154,11 @@ function RequestsSpecsList(props: {
props.selected === spec.uuid ? "bg-accent" : ""
)}
>
-
-
-
+
@@ -325,10 +328,38 @@ function RequestSpecRemovalButton(props: { spec: ProjectRequestSpec }) {
);
}
-function RequestSpecText(props: { spec: ProjectRequestSpec }) {
+function RequestSpecText(props: {
+ spec: ProjectRequestSpec;
+ className?: string;
+ maxUrlLength?: number;
+}) {
+ const getUrlVisibleText = (): string => {
+ const url = props.spec.url.trim();
+
+ if (!url) {
+ return "?";
+ }
+
+ if (!props.maxUrlLength) {
+ return props.spec.url;
+ }
+
+ if (url.length <= props.maxUrlLength + "...".length) {
+ return props.spec.url;
+ }
+
+ return "..." + url.slice(url.length - props.maxUrlLength);
+ };
+
return (
-
-
{props.spec.method}
{props.spec.url || "..."}
+
+ {props.spec.method}
{" "}
+ {getUrlVisibleText()}
);
}