feat(rank-tracking): add Last checked at column to CSV and Sheets exports#71
Open
AdarshJ173 wants to merge 1 commit into
Open
Conversation
…orts Closes every-app#70 - `buildRankTrackingExport` now accepts an optional `lastCheckedAt` string - Formats it as an ISO-8601 date string (YYYY-MM-DD) — machine-sortable in both Excel and Google Sheets - Appended as the final column so existing column indexes are unchanged - Both `exportRankTrackingCsv` and `exportRankTrackingToSheets` pass the value through from their call sites in `RankTrackingDomainDetail` - Call sites updated to forward `run?.lastCheckedAt`
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #70 — Rank Tracking exports now include a
Last checked atcolumn in both full-table and selected-row CSV and Google Sheets exports.What changed
RankTrackingTableParts.tsxformatCheckedAt(lastCheckedAt?: string | null): stringhelper that converts the stored ISO-8601 timestamp to aYYYY-MM-DDstring — machine-sortable in Excel, Google Sheets, and any CSV viewer.buildRankTrackingExportaccepts a new optionallastCheckedAt?: string | nullparameter. The formatted value is appended as the last column so all existing column indexes are unchanged (no breaking change for anyone already parsing the CSV programmatically).exportRankTrackingCsvandexportRankTrackingToSheetseach accept and forward the new parameter.RankTrackingDomainDetail.tsxonExportandonExportToSheetscall sites now passrun?.lastCheckedAt— the value already present onresultsData.run— so the column is populated automatically on every export.Acceptance criteria checklist
Last checked atYYYY-MM-DD— consistent and sortable in common spreadsheet toolsrunis null (no data yet)Testing
Manual verification path (no new unit tests needed for a single helper):
Last checked atwith aYYYY-MM-DDvalueNotes
formatCheckedAtwrapsnew Date(...).toISOString()in a try/catch to guard against malformed timestamps — returns""on failure.Greptile Summary
This PR adds a
Last checked atcolumn to Rank Tracking CSV and Google Sheets exports by threadingrun?.lastCheckedAtthroughbuildRankTrackingExport. The full-table export paths inRankTrackingDomainDetailare correctly updated, but the selected-row export paths insideRankTrackingTableare not —buildRankTrackingExportis called there withoutlastCheckedAt, so those exports will always emit a blank column.RankTrackingTableParts.tsx— addslastCheckedAtparameter and aformatCheckedAthelper tobuildRankTrackingExport,exportRankTrackingCsv, andexportRankTrackingToSheets.RankTrackingDomainDetail.tsx— passesrun?.lastCheckedAtto the two full-table export call sites; does not update the<RankTrackingTable />props, leaving selected-row exports with an emptyLast checked atvalue.Confidence Score: 3/5
Full-table exports work, but selected-row exports in RankTrackingTable.tsx always emit a blank Last checked at column because the PR did not update that component.
The selected-row export paths in RankTrackingTable.tsx call buildRankTrackingExport without lastCheckedAt, so the new column header appears but every value is empty — the PR's own acceptance criterion for selected-row exports is unmet.
RankTrackingTable.tsx needs a lastCheckedAt prop and both buildRankTrackingExport call sites updated; RankTrackingDomainDetail.tsx needs to pass run?.lastCheckedAt to
Important Files Changed
lastCheckedAtparam tobuildRankTrackingExport,exportRankTrackingCsv, andexportRankTrackingToSheets; introduces aformatCheckedAthelper that could be simplified to a direct slice since the stored value is already ISO-8601.run?.lastCheckedAtto the full-table CSV and Sheets export calls; does not pass it to<RankTrackingTable />, so selected-row exports remain broken.Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant DD as RankTrackingDomainDetail participant RT as RankTrackingTable participant TP as RankTrackingTableParts Note over DD: Full-table export DD->>TP: exportRankTrackingCsv(filtered, ..., run?.lastCheckedAt) TP->>TP: buildRankTrackingExport(..., lastCheckedAt) TP-->>DD: CSV with Last checked at populated Note over RT: Selected-row export RT->>TP: buildRankTrackingExport(selectedRankRows, showDesktop, showMobile) Note right of TP: lastCheckedAt = undefined, value is always empty TP-->>RT: Export with Last checked at header but blank values%%{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"}}}%% sequenceDiagram participant DD as RankTrackingDomainDetail participant RT as RankTrackingTable participant TP as RankTrackingTableParts Note over DD: Full-table export DD->>TP: exportRankTrackingCsv(filtered, ..., run?.lastCheckedAt) TP->>TP: buildRankTrackingExport(..., lastCheckedAt) TP-->>DD: CSV with Last checked at populated Note over RT: Selected-row export RT->>TP: buildRankTrackingExport(selectedRankRows, showDesktop, showMobile) Note right of TP: lastCheckedAt = undefined, value is always empty TP-->>RT: Export with Last checked at header but blank valuesReviews (1): Last reviewed commit: "feat(rank-tracking): add Last checked at..." | Re-trigger Greptile