Skip to content

(CF-58) Fix/distribution switch host - #55

Merged
wentz-s merged 1 commit into
devfrom
fix/distribution-switch-host
Oct 16, 2026
Merged

wentz-s merged 1 commit into
devfrom
fix/distribution-switch-host

Conversation

@wentz-s

@wentz-s wentz-s commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Changing the selected distribution kept the host from the one just left.

The selected host lives in the URL (/console/hosts/:host) and the distribution does not. So after a switch the console stayed on the old host's path under the new distribution and showed "No such host". The same happened after Unlink moved to the next distribution.

  • Whenever the selected distribution changes, the console goes back to /console, which lands on the new one's first host, or its "No hosts yet" state. That covers the switcher, Unlink moving to the next one, linking another distribution, a distribution a teammate unlinked, and Settings pointing a distribution at another table.
  • It does not happen on the first load, so a link to a host still opens that host, nor when the list reloads and the distribution comes back unchanged.
  • The navigation replaces the history entry: the host left behind is not one Back can show under the new distribution.
  • The console body is keyed on the distribution, so nothing carries over from the previous one: not its host list, and not an open editor where two distributions share a host name. The new distribution is never asked for the old one's host.

Known limit: the distribution is still not in the URL, so Back does not switch distributions. Putting it there is a separate change.

Tests

Lint, typecheck and Playwright (183/183), all green. New e2e/distribution-switch.e2e.ts (12 specs) serves each target its own hosts and rules:

  • switching lands on the new distribution's first host, shows its rules, and switching back works
  • the new distribution is never asked for the old one's host
  • a distribution with no host shows its empty state at /console
  • a host name both distributions have shows each one's own rules
  • a reload after switching keeps the distribution and its host
  • a viewer switching lands on the new host too
  • unlinking, linking another, and a teammate's unlink each land on the next distribution's host
  • Settings pointing at another table loads that table's hosts
  • a link to a host still opens it on load

10 of the 12 fail on dev; the other two (the shared host name and the deep link) guard behaviour that already worked.

Ticket

CF-58

Checklist

  • CI is green (lint, typecheck, schemas)
  • If the rule shape changed: shared/ schemas and their shared/examples/ were updated together (n/a)
  • If the rule shape changed and the console API exists (step 2): its OpenAPI spec $refs the updated schemas — no inline redefinition (n/a)
  • The module still takes no input about, and creates no, aws_cloudfront_distribution (except under examples/)

@wentz-s
wentz-s merged commit 715f8f8 into dev Oct 16, 2026
5 checks passed
@wentz-s
wentz-s deleted the fix/distribution-switch-host branch October 16, 2026 18:47
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