Repository navigation
feat: add explicit public directory display order - #127
Open
KitKat31337 wants to merge 1 commit into
Open
KitKat31337 wants to merge 1 commit into
KitKat31337 wants to merge 1 commit into
Conversation
Contributor
|
Run failed. View the logs →
|
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
Add an explicit
display_orderproperty to event types so owners can control how appointments appear on public person and team directories without renaming the event or changing its booking URL.Public directory entries are now ordered by:
display_orderascendingThe new value defaults to
0, so existing installations retain their current alphabetical directory order until an owner deliberately changes it.Related proposal: KitKat31337#3
Problem
Public person and team directories currently order event types alphabetically by name.
That works as a default, but it does not allow an operator to deliberately prioritize an event—for example, placing an introductory consultation before longer or more specialized appointments.
Ordering by slug is not a suitable workaround because it couples presentation order to the public booking URL. Slugs may also become impractical to change after an event type has accumulated bookings.
Directory order should therefore be independent of:
Behavior
Each event type now has an integer
display_order.Lower numbers appear first:
Events with the same value remain alphabetically ordered by name. Slug is used as the final tie-breaker when both the display order and name are equal.
Negative values are supported, making it possible to promote an event ahead of the default
0group without renumbering existing event types.The order applies consistently anywhere the event type appears in a public directory:
/u/{handle}/team/{slug}The change does not affect:
Implementation
Database
Add migration
00070_event_type_display_order.sqlwith:The migration is additive and preserves all existing event types. Existing rows receive the default value of
0.Consistent with the project’s other additive SQLite column migrations, the down migration leaves the column in place.
API
Expose
display_orderthrough the event-type API:nullduring PATCH also leaves the value unchanged.0explicitly resets the event to the default ordering group.The existing owner-scoped authorization remains unchanged. Being configured only as an event host does not grant permission to update the event’s directory order.
Directory queries
Both directory routes use the shared deterministic ordering rule:
The existing directory filters remain unchanged, so inactive, private, and unrelated event types are still excluded.
Admin UI
Add a Directory order number field to the event-type editor.
The UI explains that:
The frontend verifies that the submitted value is a safe whole number before sending the PATCH request.
Event duplication
Duplicating an event type retains its
display_order, along with the other reusable event-type configuration.Documentation
Document the ordering behavior in
docs/ARCHITECTURE.md, including:Backward compatibility
This is an additive schema and API change.
Existing event types receive:
{ "display_order": 0 }Because events with equal values are ordered by name, an existing directory where every event has the default value continues to appear alphabetically.
The slug tie-breaker only makes otherwise identical names deterministic.
Existing API clients may ignore the additional response property. No existing request fields or endpoint behavior are removed.
Test coverage
The included tests cover:
nullas no change00