Skip to content

Commit

Permalink
fix(ui): inconsistency in height between the AI window and the event …
Browse files Browse the repository at this point in the history
…table (#731)

## What type of PR is this?

/kind bug

## What this PR does / why we need it:

Fix the inconsistency in height between the AI window and the event
table
  • Loading branch information
hai-tian authored Jan 14, 2025
1 parent 5b356f3 commit bb6a549
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const EventAggregator: React.FC<EventAggregatorProps> = ({
const diagnosisEndRef = useRef<HTMLDivElement>(null)
const abortControllerRef = useRef<AbortController | null>(null)
const contentRef = useRef<HTMLDivElement>(null)
const tableContainerRef = useRef<HTMLDivElement>(null)

const { aiOptions } = useSelector((state: any) => state.globalSlice)
const isAIEnabled = aiOptions?.AIModel && aiOptions?.AIAuthToken
Expand Down Expand Up @@ -346,10 +347,13 @@ const EventAggregator: React.FC<EventAggregatorProps> = ({
: { flexDirection: 'row' }
const events_content_withDiagnosis_style: React.CSSProperties = isVertical
? { width: '100%' }
: { width: 'calc(100% - 424px)', height: 600, overflowY: 'scroll' }
: { width: 'calc(100% - 424px)' }
const tableHeight = tableContainerRef?.current
? tableContainerRef?.current.getBoundingClientRect()?.height
: 400
const events_content_diagnosisPanel_style: React.CSSProperties = isVertical
? { width: '100%', height: 300 }
: { width: 400, height: 600 }
: { width: 400, height: tableHeight || 400 }

const contentToTopHeight = contentRef.current?.getBoundingClientRect()?.top
const dotToTopHeight = diagnosisEndRef.current?.getBoundingClientRect()?.top
Expand Down Expand Up @@ -502,6 +506,7 @@ const EventAggregator: React.FC<EventAggregatorProps> = ({

<div className={styles.events_content} style={events_content_styles}>
<div
ref={tableContainerRef}
className={classNames(styles.events_content_tableContainer, {
[styles.events_content_withDiagnosis]: diagnosisStatus !== 'idle',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@
display: flex;
position: relative;
gap: 16px;
box-sizing: border-box;

.events_content_tableContainer {
box-sizing: border-box;
flex: 1;
transition: width 0.3s ease;

Expand Down Expand Up @@ -240,7 +242,6 @@

.events_content_diagnosisPanel {
width: 400px;
height: 600px;
border-radius: 12px;
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -919,4 +920,3 @@
transform: rotate(360deg);
}
}

0 comments on commit bb6a549

Please sign in to comment.