Compare commits

...

1 Commits

Author SHA1 Message Date
openhands
3e917b8763 fix: Remove trailing whitespace 2025-06-25 19:00:22 +00:00
2 changed files with 14 additions and 2 deletions

View File

@@ -18,7 +18,13 @@ const hasCommandProperty = (
const trimText = (text: string, maxLength: number): string => {
if (!text) return "";
return text.length > maxLength ? `${text.substring(0, maxLength)}...` : text;
if (text.length <= maxLength) return text;
// Truncate in the middle, keeping beginning and end
const half = Math.floor(maxLength / 2);
const beginning = text.substring(0, half);
const end = text.substring(text.length - half);
return `${beginning}...${end}`;
};
export const getEventContent = (

View File

@@ -21,7 +21,13 @@ import { PathComponent } from "./path-component";
const trimText = (text: string, maxLength: number): string => {
if (!text) return "";
return text.length > maxLength ? `${text.substring(0, maxLength)}...` : text;
if (text.length <= maxLength) return text;
// Truncate in the middle, keeping beginning and end
const half = Math.floor(maxLength / 2);
const beginning = text.substring(0, half);
const end = text.substring(text.length - half);
return `${beginning}...${end}`;
};
interface ExpandableMessageProps {