fix(web): fully clear diff route state when closing panel#953
fix(web): fully clear diff route state when closing panel#953copypasteitworks wants to merge 1 commit intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Merge already!! this has been driving me nuts today |
|
Can we merge either this or the other fix? its very annoying. |
|
fixed |
Summary
This also targets the diff-panel close bug addressed in #937. I noticed that PR after preparing this one, so if that approach is preferred this PR can be closed.
This affects both browser and desktop builds because the diff panel state is driven by the same web route/search logic.
This version differs in two ways:
diffCloses #931
Closes #935
Repro
Actual on
mainThe route keeps
diff=1, so the diff panel does not really close.Root Cause
The thread route retains the
diffsearch param at the route level, so explicit close navigation that strips diff params is immediately overridden by retained search state.What This Changes
stripDiffSearchParams(previous)removes diff route state from the active thread routeWhy This Differs From #937
#937 fixes the stuck-open symptom by unsetting
diff, but leavesdiffTurnIdanddiffFilePathbehind.This PR clears all diff route params on close, which keeps the URL and route state fully in sync after dismissing the panel.
Testing
bun fmtbun lintbun typecheckbun run test -- src/threadRouteSearch.test.tsmainthat: