Skip to content

refactor: update incident table to include start date and improve dat… - #761

Merged
rajnandan1 merged 1 commit into
mainfrom
do/incident-start
Jun 16, 2026
Merged

refactor: update incident table to include start date and improve dat…#761
rajnandan1 merged 1 commit into
mainfrom
do/incident-start

Conversation

@rajnandan1

@rajnandan1 rajnandan1 commented Jun 16, 2026

Copy link
Copy Markdown
Owner

…e formatting

Summary by CodeRabbit

  • New Features

    • Added "Started" column to incidents table for improved visibility of incident initiation times.
  • Improvements

    • Standardized date formatting throughout the incidents interface for consistent, reliable display across all date fields and tooltips.

Copilot AI review requested due to automatic review settings June 16, 2026 03:46
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 09c095c8-a173-456f-b974-6f26de745799

📥 Commits

Reviewing files that changed from the base of the PR and between e43186d and 8833b7e.

📒 Files selected for processing (1)
  • src/routes/(manage)/manage/app/incidents/+page.svelte

📝 Walkthrough

Walkthrough

The incidents management page switches date formatting from date-fns's format function to the app's $formatDate store-based formatter. A new "Started" column is added to the incidents table, rendering incident.start_date_time. The empty-state row colspan is incremented from 6 to 7, and the tooltip "To" date is updated to use $formatDate.

Changes

Incidents Table Date Formatting and Started Column

Layer / File(s) Summary
Import swap, Started column, and updated date rendering
src/routes/(manage)/manage/app/incidents/+page.svelte
Replaces the date-fns format import with formatDate from the app datetime store; adds a "Started" column header and per-row cell rendering incident.start_date_time via $formatDate; updates empty-state colspan from 6 to 7; updates the tooltip "To" value from a manual new Date(... * 1000) + format call to $formatDate(incident.end_date_time, ...).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A bunny hopped by and said, "Oh my!
These timestamps were built wrong, let's fix the supply!"
$formatDate now rules the row,
With a "Started" column putting on a show. 🐇
colspan bumped up, the table's just right—
No more raw date-fns to cloud our sight! ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch do/incident-start

Comment @coderabbitai help to get the list of available commands and usage tips.

@rajnandan1
rajnandan1 merged commit caf7427 into main Jun 16, 2026
1 of 2 checks passed
@rajnandan1
rajnandan1 deleted the do/incident-start branch June 16, 2026 03:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the manage-side incidents table to surface an explicit “Started” timestamp and standardize incident date/time rendering through the app’s timezone/locale-aware datetime utilities.

Changes:

  • Adds a new Started column to the incidents table.
  • Switches incident start/end timestamp formatting from direct date-fns/format(new Date(...)) to the reactive $formatDate(...) helper (timezone + locale aware).
  • Updates the empty-state row colspan to match the new column count.

@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a "Started" column to the incidents management table and migrates date formatting from the static date-fns/format import to the reactive $formatDate derived store, which provides timezone and locale support.

  • A new "Started" Table.Head/Table.Cell pair is added, displaying $formatDate(incident.start_date_time, \"yyyy-MM-dd HH:mm\") with proper w-40 column sizing, and the empty-state colspan is correctly updated from 6 to 7.
  • The format import from date-fns is removed and replaced with the $formatDate store from $lib/stores/datetime, which internally handles Unix-second timestamps (via the parseDateInput helper's < 10000000000 guard) and respects the user's selected timezone and locale reactively.

Confidence Score: 5/5

Safe to merge — the change adds a new column and swaps a static format call for a reactive store with no behavioral regressions.

The new 'Started' column is purely additive, the colspan update from 6 to 7 is correct, and the migration to $formatDate correctly handles Unix-second timestamps via the existing parseDateInput guard. No data paths are broken and no pre-existing functionality is removed.

No files require special attention.

Important Files Changed

Filename Overview
src/routes/(manage)/manage/app/incidents/+page.svelte Adds a 'Started' column to the incidents table, updates colspan from 6 to 7, and replaces static date-fns format calls with the reactive $formatDate store for timezone/locale awareness.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[incident.start_date_time\nUnix seconds] -->|passed to| B["$formatDate(date, formatStr)"]
    B --> C[parseDateInput]
    C -->|"date < 10_000_000_000?"| D["new Date(date * 1000)\nUnix seconds → ms"]
    D --> E[toZonedTime\ntz from selectedTimezone store]
    E --> F[format\nlocale from dateFnsLocale store]
    F -->|rendered in| G["'Started' column\nyyyy-MM-dd HH:mm"]
    F -->|also rendered in| H["Duration tooltip\nFrom / To"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[incident.start_date_time\nUnix seconds] -->|passed to| B["$formatDate(date, formatStr)"]
    B --> C[parseDateInput]
    C -->|"date < 10_000_000_000?"| D["new Date(date * 1000)\nUnix seconds → ms"]
    D --> E[toZonedTime\ntz from selectedTimezone store]
    E --> F[format\nlocale from dateFnsLocale store]
    F -->|rendered in| G["'Started' column\nyyyy-MM-dd HH:mm"]
    F -->|also rendered in| H["Duration tooltip\nFrom / To"]
Loading

Reviews (1): Last reviewed commit: "refactor: update incident table to inclu..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants