Skip to content

Commit

Permalink
🐛 Align truncate with full screen expectations (#165)
Browse files Browse the repository at this point in the history
Closes #164

Signed-off-by: Ian Bolton <[email protected]>
  • Loading branch information
ibolton336 authored Dec 16, 2024
1 parent c47bee7 commit 637c294
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions webview-ui/src/components/ViolationIncidentsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@ import {
Button,
Stack,
StackItem,
Tooltip,
TextInput,
Select,
SelectOption,
MenuToggle,
Label,
MenuToggleElement,
InputGroup,
Divider,
DataListAction,
DataListCell,
DataListItem,
DataListItemCells,
DataListItemRow,
CardHeader,
CardExpandableContent,
CardFooter,
} from "@patternfly/react-core";
import { SortAmountDownIcon, TimesIcon, FileIcon, LightbulbIcon } from "@patternfly/react-icons";
import { Incident, Violation, Severity } from "@editor-extensions/shared";
Expand Down Expand Up @@ -204,7 +201,7 @@ const ViolationIncidentsList: React.FC<ViolationIncidentsListProps> = ({
};
const isExpanded = expandedViolations.has(violation.description);
const highestSeverity = getHighestSeverity(violation.incidents);
const truncatedDescription = truncateText(violation.description, 35);
const truncatedDescription = truncateText(violation.description, 100);

return (
<Card
Expand All @@ -224,9 +221,7 @@ const ViolationIncidentsList: React.FC<ViolationIncidentsListProps> = ({
// }}
onExpand={() => toggleViolation(violation.description)}
>
<Tooltip content={violation.description}>
<Content style={{ marginBottom: "5px" }}>{truncatedDescription}</Content>
</Tooltip>
<Content style={{ marginBottom: "5px" }}>{truncatedDescription}</Content>
<Flex>
<Label color="blue" isCompact>
{violation.incidents.length} incidents
Expand All @@ -250,11 +245,9 @@ const ViolationIncidentsList: React.FC<ViolationIncidentsListProps> = ({
{violation.incidents.map((incident) => (
<div key={`${incident.uri}-${incident.lineNumber}`}>
{renderIncident(incident, violation)}
<Divider />
</div>
))}
</CardBody>
<CardFooter>Additional Actions</CardFooter>
</CardExpandableContent>
</Card>
);
Expand Down

0 comments on commit 637c294

Please sign in to comment.