Skip to content

Fix coordinate formatting consistency and empty filter state handling#1057

Merged
karilint merged 1 commit intocodex/plan-feature-implementation-for-locality-listfrom
copilot/sub-pr-1054
Feb 16, 2026
Merged

Fix coordinate formatting consistency and empty filter state handling#1057
karilint merged 1 commit intocodex/plan-feature-implementation-for-locality-listfrom
copilot/sub-pr-1054

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

Coordinate values in CrossSearchTable displayed excessive decimal precision inconsistent with LocalityTable. Empty filter values polluted URL state and server queries.

Changes

  • Coordinate formatting: Added formatWithMaxThreeDecimals formatter to dec_lat and dec_long columns in CrossSearchTable, matching LocalityTable behavior. Handles both numeric and string coordinate values.

  • Filter state sanitization: TableView now excludes empty filter values (empty strings, null, undefined, empty arrays) from URL state and server-side queries via sanitizeColumnFilters.

  • Test coverage: Added LocalityTable tests verifying coordinate formatting preserves values ≤3 decimals and truncates longer values. CrossSearchTable tests added for parity.

// Before: 12.3456789 displayed as-is
// After: 12.3456789 → "12.346", 12.3 → 12.3

const formatWithMaxThreeDecimals = (value: unknown): number | string => {
  const numericValue = typeof value === 'number' ? value : typeof value === 'string' ? Number(value) : Number.NaN
  if (!Number.isFinite(numericValue)) return ''
  if (decimalCount(numericValue) > 3) return numericValue.toFixed(3)
  return numericValue
}

Note: formatWithMaxThreeDecimals and decimalCount are duplicated across both table components - could be extracted to shared utility in follow-up.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix unexpected error in Codex-generated pull request Fix coordinate formatting consistency and empty filter state handling Feb 16, 2026
Copilot AI requested a review from karilint February 16, 2026 10:58
@karilint karilint marked this pull request as ready for review February 16, 2026 13:44
@karilint karilint merged commit 6211a5e into codex/plan-feature-implementation-for-locality-list Feb 16, 2026
1 check passed
@karilint karilint deleted the copilot/sub-pr-1054 branch February 16, 2026 13:44
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

Comments