Skip to content

fix: eliminate route transition fallback flash#276

Merged
Just-Insane merged 7 commits into
integrationfrom
codex/issue-219-visual-flash
Jun 22, 2026
Merged

fix: eliminate route transition fallback flash#276
Just-Insane merged 7 commits into
integrationfrom
codex/issue-219-visual-flash

Conversation

@Just-Insane

Copy link
Copy Markdown
Collaborator

Description

Keep joined home and space routes mounted while room/space lists and parent mappings catch up, so navigation does not flash the fallback join card during route, menu, or first-load transitions.

Closes #219
Related to #238

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Validation:

  • pnpm lint
  • pnpm fmt:check
  • pnpm typecheck
  • pnpm test:run
  • pnpm knip
  • pnpm build

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (adds joined-route guards for home/space navigation, restores direct-space child rendering before parent maps refresh, and covers the regression with focused route-provider tests).

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

Sentry Preview Error Triage

No Sentry errors found for this PR's preview deployment as of Mon, 22 Jun 2026 14:53:26 GMT.

This comment updates automatically after each push.

@github-code-quality

github-code-quality Bot commented Jun 22, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: JavaScript

JavaScript / code-coverage/vitest

The overall coverage in the branch remains at 26%, unchanged from the branch.

Show a code coverage summary of the most impacted files.
File 66ef3dd db2632b +/-
src/app/pages/c...oomProvider.tsx 0% 87% +87%
src/app/pages/c...oomProvider.tsx 0% 92% +92%
src/app/pages/c...aceProvider.tsx 0% 100% +100%

Updated June 22, 2026 14:56 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

Comment thread src/app/pages/client/space/RoomProvider.tsx Outdated
Comment thread src/app/pages/client/home/RoomProvider.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b34137779

ℹ️ 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".

Comment thread src/app/pages/client/space/SpaceProvider.tsx Outdated
Comment thread src/app/pages/client/space/RoomProvider.tsx Outdated
Comment thread src/app/pages/client/home/RoomProvider.tsx Outdated
Comment thread .changeset/fix-route-transition-flash.md Outdated
Comment thread src/app/pages/client/home/RoomProvider.tsx Outdated
Comment thread src/app/pages/client/space/RoomProvider.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7aafd7bcc7

ℹ️ 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".

Comment thread src/app/pages/client/space/RoomProvider.tsx Outdated
Comment thread src/app/pages/client/home/RoomProvider.tsx Outdated
Comment thread src/app/pages/client/space/RoomProvider.tsx Outdated
Comment thread src/app/pages/client/home/RoomProvider.tsx Outdated
Comment thread src/app/pages/client/space/RoomProvider.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 410339dd2f

ℹ️ 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".

Comment thread src/app/pages/client/home/RoomProvider.tsx Outdated
Comment thread src/app/pages/client/home/RoomProvider.tsx
@github-actions

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

Status Preview URL Commit Alias Updated (UTC)
✅ Deployment successful! https://pr-276-charm.justin-tech.workers.dev 2b35987 pr-276 Mon, 22 Jun 2026 14:55:26 GMT

@Just-Insane Just-Insane merged commit c6e3d8f into integration Jun 22, 2026
18 checks passed
@Just-Insane Just-Insane deleted the codex/issue-219-visual-flash branch June 22, 2026 14:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db2632b87b

ℹ️ 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".

if (!room || !allRooms.includes(room.roomId)) {
useEffect(() => {
if (!room) return;
if (!isDirectSpaceChild && !liveDirectParentSpace) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not cache child-declared space parents

When a joined room has an m.space.parent event naming the selected space but that space does not have a valid m.space.child event for the room, this effect still writes space.roomId -> room.roomId into roomToParentsAtom. The rest of the space navigation graph is derived from the parent space's child events via getSpaceChildren/getRoomToParents, so a stale or unaccepted child-declared parent can be persisted and make an unrelated room render as a child of this space until the next reset; only repair the cache from the space's own child event, or validate the parent link before PUT.

Useful? React with 👍 / 👎.

Comment on lines +45 to +47
const canRenderSpaceRoom =
!!room &&
(isRoom(room) || (developerTools && room.isSpaceRoom() && room.roomId === space.roomId));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow call rooms through the space route guard

When a joined voice/call room is opened from a space, the space nav still lists it as a non-space child because room.isSpaceRoom() is false, and Room has a supported call view via room.isCallRoom(). This new guard requires isRoom(room), but isRoom returns false for typed rooms such as RoomType.UnstableCall, so those supported space children now fall through to the join fallback instead of opening. Allow call rooms here, or gate only actual spaces.

Useful? React with 👍 / 👎.

useSpaces: () => mockUseSpaces(),
}));

vi.mock('$utils/room', () => ({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve room utility exports in the mock

Because vi.mock is hoisted, this $utils/room mock is active while the imported roomToParentsAtom module is loaded. That atom module imports getRoomToParents, isValidChild, and mapParentWithChildren, but the mock does not return them, so this new test file can fail at module load with Vitest's missing-export error before any assertions run; spread vi.importActual('$utils/room') or provide those exports.

Useful? React with 👍 / 👎.

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.

Eliminate route, menu, and first-load visual flash

1 participant