truncate metric headers and values

This commit is contained in:
Nate Kelley 2025-07-08 09:44:53 -06:00
parent 75e5c1ec4b
commit f4c2515f25
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 27 additions and 7 deletions

View File

@ -208,7 +208,7 @@ const AnimatedTitleWrapper = ({ title, type }: { title: string; type: 'header' |
return ( return (
<AnimatePresence mode="wait" initial={false}> <AnimatePresence mode="wait" initial={false}>
{title && ( {title && (
<motion.div className="overflow-visible" {...memoizedAnimation}> <motion.div className="w-full overflow-visible text-center" {...memoizedAnimation}>
<motion.div className="origin-center"> <motion.div className="origin-center">
<Title truncate as="h4"> <Title truncate as="h4">
{title} {title}

View File

@ -190,3 +190,25 @@ export const CustomValueLabel: Story = {
</div> </div>
) )
}; };
export const WithLongTextValue: Story = {
args: {
data: [{ value: 'This is a long text value that should be wrapped' }],
metricColumnId: 'value',
columnLabelFormats: {
value: {
...DEFAULT_COLUMN_LABEL_FORMAT,
columnType: 'text',
style: 'string'
} as ColumnLabelFormat
},
metricHeader: 'Long Text Value that is like really long',
metricSubHeader: 'This is a long text value that should be wrapped',
animate: true
},
render: (args) => (
<div className="w-80vw h-[200px] rounded-md border border-red-500 p-4">
<BusterMetricChart {...args} />
</div>
)
};

View File

@ -1,6 +1,6 @@
import { z } from "zod/v4"; import { z } from 'zod/v4';
import { ShareRoleSchema, VerificationStatusSchema } from "../share"; import { ShareRoleSchema, VerificationStatusSchema } from '../share';
import { ChartConfigPropsSchema } from "./charts"; import { ChartConfigPropsSchema } from './charts';
export const GetMetricRequestSchema = z.object({ export const GetMetricRequestSchema = z.object({
id: z.string(), id: z.string(),
@ -81,9 +81,7 @@ export type GetMetricRequest = z.infer<typeof GetMetricRequestSchema>;
export type GetMetricListRequest = z.infer<typeof GetMetricListRequestSchema>; export type GetMetricListRequest = z.infer<typeof GetMetricListRequestSchema>;
export type UpdateMetricRequest = z.infer<typeof UpdateMetricRequestSchema>; export type UpdateMetricRequest = z.infer<typeof UpdateMetricRequestSchema>;
export type DeleteMetricRequest = z.infer<typeof DeleteMetricRequestSchema>; export type DeleteMetricRequest = z.infer<typeof DeleteMetricRequestSchema>;
export type DuplicateMetricRequest = z.infer< export type DuplicateMetricRequest = z.infer<typeof DuplicateMetricRequestSchema>;
typeof DuplicateMetricRequestSchema
>;
export type BulkUpdateMetricVerificationStatusRequest = z.infer< export type BulkUpdateMetricVerificationStatusRequest = z.infer<
typeof BulkUpdateMetricVerificationStatusRequestSchema typeof BulkUpdateMetricVerificationStatusRequestSchema
>; >;