Skip to content

Conversation

@aayush-se
Copy link
Member

@aayush-se aayush-se commented Dec 31, 2025

  • Use agentic search endpoint for translation for internal use instead of the one shot workflow
  • Update to support start/end
    • Don't show time if beginning to end of day
Screenshot 2026-01-02 at 12 52 02 PM Screenshot 2026-01-02 at 12 52 06 PM Screenshot 2026-01-02 at 12 52 13 PM Screenshot 2026-01-02 at 12 52 39 PM Screenshot 2026-01-02 at 12 52 45 PM

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 31, 2025
@aayush-se aayush-se marked this pull request as ready for review January 2, 2026 21:42
@aayush-se aayush-se requested a review from a team as a code owner January 2, 2026 21:42
Comment on lines +203 to +210
if (resultStart && resultEnd) {
// Strip 'Z' suffix to treat UTC dates as local time
const startLocal = resultStart.endsWith('Z')
? resultStart.slice(0, -1)
: resultStart;
const endLocal = resultEnd.endsWith('Z') ? resultEnd.slice(0, -1) : resultEnd;
start = new Date(startLocal).toISOString();
end = new Date(endLocal).toISOString();

This comment was marked as outdated.

Copy link
Contributor

@nsdeschenes nsdeschenes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small nit, and one thing that may be consolidated, rest is looking amazing!

🚀 🌔

Comment on lines 12 to 13
const startLocal = start.endsWith('Z') ? start.slice(0, -1) : start;
const endLocal = end.endsWith('Z') ? end.slice(0, -1) : end;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may be able to "translate" this to local using moment, as we use the moment-timezone package 👀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, realizing ill have to do a few follow ups here as I need to make the Seer endpoint timezone aware. Right not it just assumes everything is UTC which is why I stripped the Z but that was a bandaid solution. Will update to moment then do a follow up after

Comment on lines 82 to 125
function formatDateRangeForText(start: string, end: string): string {
// Treat UTC dates as local dates by removing the 'Z' suffix
const startLocal = start.endsWith('Z') ? start.slice(0, -1) : start;
const endLocal = end.endsWith('Z') ? end.slice(0, -1) : end;

const startDate = new Date(startLocal);
const endDate = new Date(endLocal);

// Check if times are at midnight (date-only range)
const startIsMidnight =
startDate.getHours() === 0 &&
startDate.getMinutes() === 0 &&
startDate.getSeconds() === 0;
const endIsMidnight =
endDate.getHours() === 0 && endDate.getMinutes() === 0 && endDate.getSeconds() === 0;
const endIsEndOfDay =
endDate.getHours() === 23 &&
endDate.getMinutes() === 59 &&
endDate.getSeconds() === 59;

const useDateOnly = startIsMidnight && (endIsMidnight || endIsEndOfDay);

const dateOptions: Intl.DateTimeFormatOptions = {
month: 'short',
day: 'numeric',
year: 'numeric',
};

const dateTimeOptions: Intl.DateTimeFormatOptions = {
month: 'short',
day: 'numeric',
year: 'numeric',
hour: 'numeric',
minute: '2-digit',
};

const formatOptions = useDateOnly ? dateOptions : dateTimeOptions;

const startFormatted = startDate.toLocaleString('en-US', formatOptions);
const endFormatted = endDate.toLocaleString('en-US', formatOptions);

return `${startFormatted} to ${endFormatted}`;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like the same function in askSeerCombobox/queryTokens.tsx, can they be consolidated into a single function here in utils, and imported into queryTokens?

@aayush-se aayush-se merged commit c3c193d into master Jan 5, 2026
52 checks passed
@aayush-se aayush-se deleted the trace-explorer/use-agentic-search branch January 5, 2026 19:45
cathteng pushed a commit that referenced this pull request Jan 5, 2026
- Use agentic search endpoint for translation for internal use instead
of the one shot workflow
- Update to support start/end
	- Don't show time if beginning to end of day
<img width="2483" height="709" alt="Screenshot 2026-01-02 at 12 52
02 PM"
src="https://github.com/user-attachments/assets/413c6e0f-9149-4f00-94eb-965cef38e554"
/>
<img width="1892" height="577" alt="Screenshot 2026-01-02 at 12 52
06 PM"
src="https://github.com/user-attachments/assets/ec6408d2-68dc-45d0-b710-7b4b97071eb9"
/>
<img width="1848" height="531" alt="Screenshot 2026-01-02 at 12 52
13 PM"
src="https://github.com/user-attachments/assets/6413fec0-8c3d-412d-b9ee-fbbe5471547f"
/>
<img width="1746" height="256" alt="Screenshot 2026-01-02 at 12 52
39 PM"
src="https://github.com/user-attachments/assets/e4c6e080-52c0-4997-936f-49e2162d4adf"
/>
<img width="1251" height="547" alt="Screenshot 2026-01-02 at 12 52
45 PM"
src="https://github.com/user-attachments/assets/d75c2945-48a2-477f-82ee-fc0040981890"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants