Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: custom time width and refresh text visibility issues (#4428)

Yunus M5b0e3d375a39
diff --git a/frontend/src/components/CustomTimePicker/CustomTimePicker.styles.scss b/frontend/src/components/CustomTimePicker/CustomTimePicker.styles.scss
index 3304232d65..6e38e84300 100644
--- a/frontend/src/components/CustomTimePicker/CustomTimePicker.styles.scss
+++ b/frontend/src/components/CustomTimePicker/CustomTimePicker.styles.scss
@@ -37,6 +37,12 @@
padding: 4px 8px;
padding-left: 0px !important;
+ &.custom-time {
+ input:not(:focus) {
+ min-width: 240px;
+ }
+ }
+
input::placeholder {
color: white;
}
diff --git a/frontend/src/components/CustomTimePicker/CustomTimePicker.tsx b/frontend/src/components/CustomTimePicker/CustomTimePicker.tsx
index abefa8fd6f..4ded57d250 100644
--- a/frontend/src/components/CustomTimePicker/CustomTimePicker.tsx
+++ b/frontend/src/components/CustomTimePicker/CustomTimePicker.tsx
@@ -178,7 +178,10 @@ function CustomTimePicker({
return (
<div className="custom-time-picker">
<Popover
- className="timeSelection-input-container"
+ className={cx(
+ 'timeSelection-input-container',
+ selectedTime === 'custom' && inputValue === '' ? 'custom-time' : '',
+ )}
placement="bottomRight"
getPopupContainer={popupContainer}
content={content}
@@ -193,12 +196,7 @@ function CustomTimePicker({
<Input
className="timeSelection-input"
type="text"
- style={{
- minWidth: '120px',
- width: '100%',
- }}
status={inputValue && inputStatus === 'error' ? 'error' : ''}
- allowClear={!isInputFocused && selectedTime === 'custom'}
placeholder={
isInputFocused
? 'Time Format (1m or 2h or 3d or 4w)'
diff --git a/frontend/src/container/TopNav/DateTimeSelection/DateTimeSelection.styles.scss b/frontend/src/container/TopNav/DateTimeSelection/DateTimeSelection.styles.scss
new file mode 100644
index 0000000000..ea853553f0
--- /dev/null
+++ b/frontend/src/container/TopNav/DateTimeSelection/DateTimeSelection.styles.scss
@@ -0,0 +1,3 @@
+.date-time-selection-container {
+ margin-bottom: 16px;
+}
diff --git a/frontend/src/container/TopNav/DateTimeSelection/index.tsx b/frontend/src/container/TopNav/DateTimeSelection/index.tsx
index c73b5f6d36..d776eb25e2 100644
--- a/frontend/src/container/TopNav/DateTimeSelection/index.tsx
+++ b/frontend/src/container/TopNav/DateTimeSelection/index.tsx
@@ -1,3 +1,5 @@
+import './DateTimeSelection.styles.scss';
+
import { SyncOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import getLocalStorageKey from 'api/browser/localstorage/get';
@@ -294,7 +296,7 @@ function DateTimeSelection({
}, [location.pathname, updateTimeInterval, globalTimeLoading]);
return (
- <>
+ <div className="date-time-selection-container">
<Form
form={formSelector}
layout="inline"
@@ -335,7 +337,7 @@ function DateTimeSelection({
</FormContainer>
</Form>
- {!hasSelectedTimeError && (
+ {!hasSelectedTimeError && selectedTime !== 'custom' && (
<RefreshText
{...{
onLastRefreshHandler,
@@ -351,7 +353,7 @@ function DateTimeSelection({
setCustomDTPickerVisible(false);
}}
/>
- </>
+ </div>
);
}
diff --git a/frontend/src/container/TopNav/DateTimeSelection/styles.ts b/frontend/src/container/TopNav/DateTimeSelection/styles.ts
index e87f2ff92a..67cfa33083 100644
--- a/frontend/src/container/TopNav/DateTimeSelection/styles.ts
+++ b/frontend/src/container/TopNav/DateTimeSelection/styles.ts
@@ -24,7 +24,6 @@ interface Props {
}
export const RefreshTextContainer = styled.div<Props>`
- min-height: 2rem;
visibility: ${({ refreshButtonHidden }): string =>
refreshButtonHidden ? 'hidden' : 'visible'};
`;