Repository navigation
fix(kin): standing-rules drafts survive closing Settings, Escape and a dropped host connection - #1107
Merged
Merged
Conversation
… dropped host On web, closing Settings with the X, or Escape then Cancel, closed it without asking and lost the owner's unsaved rules, and any blip in the host connection unmounted Settings and lost them too. - Settings' modal takes an optional close guard from the page inside it. The rules page registers one while it holds a draft, so the X, Escape and a backdrop press ask "Discard what you typed?" (Keep editing / Discard); Keep editing leaves Settings open with the draft and the caret. Page switches, links and Back ask the same question with the same words. - Settings stays mounted for the same company while its host is offline. Check-ins, Sections and Deals now take Settings' company instead of a connected-only lookup, so they no longer go blank offline. - "Kin checked … ago" and "Changed … by …" move on with the minute clock, the owner's own change reads "by you", and withdrawing every rule says the agents follow no standing rules. - Save stays in view at the foot of Settings however tall the page. - Phone: the status, the too-large line (now styled as an error) are said aloud when they appear. People-change: none Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… T3's route modal The close guard added 53 lines to T3's AppRouteModal.tsx, each a future merge conflict with upstream. It now lives in apps/web/src/kin/KinRouteModalGuard.tsx: the context, the page's useKinModalCloseGuard, the guard ref and the ask-then- close logic. AppRouteModal keeps an import, one hook call and three one-line call sites (5 added lines). With no page guarding, every close is upstream's own. People-change: none Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
People-change: none Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This PR changes the test suite by +6 test cases (browser +6, unit 0, server 0). New browser test files: Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing. |
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.
On web, the owner's unsaved standing rules were lost without asking in three ways: closing Settings with the X, pressing Escape and then Cancel, and any drop in the host connection, which unmounted Settings. A walk in a real client also found smaller faults: a frozen "Kin checked … just now", generic Cancel/Confirm buttons on the leave question, "these" after withdrawing every rule, the owner named in the third person about their own change, Save below the fold, and phone status lines that a screen reader never hears.
What changed
AppRouteModaltakes an optional close guard from the page inside it (useAppRouteModalCloseGuard). With no guard it closes exactly as before. The rules page registers one while it holds a draft, so the X, Escape and a backdrop press ask "Discard what you typed?" with Keep editing and Discard. Keep editing leaves Settings open with the draft and the caret. Switching Settings page, a link, Back or reload asks the same question with the same buttons.Not changed: a non-owner landing on Profile still keeps
?settings=rulesin the address. Settings' permissions read "not allowed" until the session is known, so rewriting the address there would also send the owner's own link to Profile while the page loads.Tests
Browser tests cover the close button and Escape, route changes, the offline Settings, a page going blank offline, the clock and "by you", and Save at 1280×800. Shared tests cover "by you" and the empty-rulebook line. Each test failed before its fix. Checked as part of train 19's one check at the tip.
People-change: none
🤖 Generated with Claude Code