Skip to content

feat: sort services in breadcrumb dropdown by user preference#4388

Open
vadamk wants to merge 1 commit into
Dokploy:canaryfrom
vadamk:feat/breadcrumb-services-sort
Open

feat: sort services in breadcrumb dropdown by user preference#4388
vadamk wants to merge 1 commit into
Dokploy:canaryfrom
vadamk:feat/breadcrumb-services-sort

Conversation

@vadamk
Copy link
Copy Markdown
Contributor

@vadamk vadamk commented May 12, 2026

Summary

  • The breadcrumb service selector dropdown now sorts services using the same servicesSort preference (from localStorage) that the environment page already uses
  • Adds createdAt to the breadcrumb's ServiceItem type so date-based sorting works
  • Listens for storage events to stay in sync when the user changes sort on the environment page
  • Pre-computes timestamps for date sorts to avoid repeated new Date() allocations in the comparator
  • Uses lastIndexOf("-") to safely parse sort values like lastDeploy-desc

Context

Currently the environment page lets users pick a sort order (name, type, createdAt, lastDeploy × asc/desc) and persists it in localStorage under servicesSort. But the breadcrumb's service dropdown ignores this preference and always shows services in the default extraction order. This PR makes both views consistent.

Note: lastDeploy sort falls back to createdAt in the breadcrumb since lastDeployDate is not available from the environment.one query used here.

Test plan

  • Open a project environment page, change the service sort (e.g. name ascending)
  • Navigate to a service — verify the breadcrumb dropdown lists services in the same order
  • Change sort on the environment page in another tab — verify the breadcrumb updates (cross-tab sync via storage event)
  • Verify default sort (lastDeploy-desc) works when no preference is saved

🤖 Generated with Claude Code

The breadcrumb service selector now respects the same sort preference
(stored in localStorage as "servicesSort") that the environment page uses.
Listens for cross-tab storage events to stay in sync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vadamk vadamk requested a review from Siumauricio as a code owner May 12, 2026 13:22
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant