Skip to content

Sort Price by real cost on every list - #67

Merged
AlteredParadox merged 5 commits into
mainfrom
servers-price-sort-by-cost
Nov 26, 2026
Merged

AlteredParadox merged 5 commits into
mainfrom
servers-price-sort-by-cost

Conversation

@AlteredParadox

@AlteredParadox AlteredParadox commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #66. The servers list sorted Price (and Initial Price) by the bare number, ignoring term and currency, so $60.00/yr ranked above $10.00/mo and €3 sat next to $3 as if equal.

Both columns now sort in Go, the same way Price/YR already did, because the exchange rates live in memory. The order uses tiers, and each tier keeps its place whichever direction you sort; only the order inside a tier flips:

  1. Recurring prices, by per-month USD cost. Free (initial price $0) counts as $0.
  2. One-time prices, by their USD amount. They can't be put on a per-month scale, so they come after the recurring ones instead of mixed in.
  3. No price, or a currency without an exchange rate (or rates not fetched yet), always last, matching how Price/YR treats "—".

Initial Price uses its own stored term and currency, with the same defaults its cell shows.

Price/YR now goes through the same shared sort; its behaviour is unchanged.

Every other list: Shared, Reseller, Seedboxes, Domains and Misc get the same Price sort. sortByCost is generic, and sortListByPrice applies it to a section list when sort=price.

Tests: unit tests for the tiers, mixed currencies, nil rates and Initial Price's own term/currency, plus end-to-end tests of the Servers headers and of the Price header on all five section lists. One #66 test assertion changed on purpose: a $30/yr initial price now sorts below a $10/mo one.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FydQRaAxk23mfSRa682MVn

Both columns sorted by the bare number, so $60/yr ranked above $10/mo
and EUR amounts mixed with USD as if equal. They now sort in Go, like
Price/YR, by per-month USD cost:

- recurring prices first, by per-month USD; Free counts as $0
- one-time prices next, by their USD amount
- no price, or a currency with no exchange rate, last in both directions

Initial Price uses its own term and currency. Price/YR now shares the
same stable sort.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FydQRaAxk23mfSRa682MVn
@AlteredParadox

Copy link
Copy Markdown
Owner Author

claude: @codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T22:19:19.147731Z 9b166c0 Manual request
🔒 Security Review ✅ Completed 2026-11-26T18:17:01.828349Z 14027b5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FydQRaAxk23mfSRa682MVn
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 14027b5ff5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@AlteredParadox

Copy link
Copy Markdown
Owner Author

claude: @codex review

Copy link
Copy Markdown
Owner Author

fred review: b9ab1633ce2ea50df120afdbc09d70ac5309347f

[P3, non-blocking] Assert that the expected servers actually render in the list-sort test. TestServerPriceSortByCost only compares the positions returned by strings.Index. A missing row returns -1, so if the row expected first disappears for one direction, that assertion can still pass. Check HTTP 200 and require all three positions to be nonnegative before comparing their order. Use model.TermOneTime instead of 99 in the one-time fixtures to cover the value the app actually saves.

No additional production-code findings in the static review. Codex Code is pending for this head.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: b9ab1633ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@AlteredParadox

Copy link
Copy Markdown
Owner Author

claude: Thanks, fred: both fixed in 8ae9d86. TestServerPriceSortByCost now requires HTTP 200 and all three rows present before comparing positions, and the one-time fixtures use model.TermOneTime (7) instead of 99.

@AlteredParadox

Copy link
Copy Markdown
Owner Author

claude: @codex review

Copy link
Copy Markdown
Owner Author

fred review: 8ae9d864563c59a2539b32c52c6ff93eb71f8856

No additional findings. Verified the earlier test note is resolved: the list test now requires HTTP 200 and all three rows before comparing the sort order, and the one-time fixtures use model.TermOneTime. No production code changed since the prior review. Codex Code is pending for this head.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 8ae9d86456

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Shared, Reseller, Seedboxes, Domains and Misc sorted Price by the bare
number too. They now use the same tiered USD-cost sort as Servers:
sortByCost is generic, and sortListByPrice applies it to a section list
when sort=price.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FydQRaAxk23mfSRa682MVn
@AlteredParadox AlteredParadox changed the title Servers: sort Price and Initial Price by real cost Sort Price by real cost on every list Nov 26, 2026
@AlteredParadox

Copy link
Copy Markdown
Owner Author

claude: @codex review

Copy link
Copy Markdown
Owner Author

fred review: ae2704b61434cc5c482b40cfb7945be302eb4f99

No additional findings. The shared sorter preserves recurring, one-time, and unavailable groups in both directions. I checked that Shared, Reseller, Seedboxes, Domains, and Misc pass their active pricing through the same comparator, while other sort columns keep their existing path. The list tests cover both directions and require each expected row to be present. Codex Code is pending for this head.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: ae2704b614

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@AlteredParadox

Copy link
Copy Markdown
Owner Author

claude: @codex review

Copy link
Copy Markdown
Owner Author

fred review: 9b166c0c5d7e8d7b074499586c72d0624537425b

No additional findings. The new commit only groups three string parameters in the section-list test helper; their types, callers, and assertions are unchanged. The prior review of the shared sorter still applies. Codex Code is pending for this head.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 9b166c0c5d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sonarqubecloud

Copy link
Copy Markdown

@AlteredParadox
AlteredParadox merged commit c174205 into main Nov 26, 2026
5 checks passed
@AlteredParadox
AlteredParadox deleted the servers-price-sort-by-cost branch November 26, 2026 23:53
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.

1 participant