Repository navigation
refactor(config): split HandleWebMessage into one handler per bridge message - #479
Merged
Merged
Conversation
Move-only: the branch body is now OnReady(), called from the same place in the dispatch chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
…HandleWebMessage (#474) Move-only: the branch body is now OnSetConfig(wv, j, type), called from the same place in the dispatch chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
#474) Move-only: the branch body is now OnSaveSession(wv), called from the same place in the dispatch chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
…sage (#474) Move-only: the branch body is now OnDiscardSession(wv), called from the same place in the dispatch chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
Move-only: the branch body is now OnWindowAction(wv, j), called from the same place in the dispatch chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
) Move-only: the branch body is now OnPickExe(wv), called from the same place in the dispatch chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
) Move-only: the branch body is now OnOpenIni(), called from the same place in the dispatch chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
…Message (#474) Move-only: the branch body is now OnExportDiagnostics(), called from the same place in the dispatch chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
…age (#474) Move-only: the branch body is now OnCreateProfile(wv, j), called from the same place in the dispatch chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
…age (#474) Move-only: the branch body is now OnDeleteProfile(wv, j), called from the same place in the dispatch chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
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.
Closes #474
Move-only split of
HandleWebMessage(src/config_ui/main.cpp, 200 lines before) into one static handler per bridge message. The dispatch if-chain stays inHandleWebMessage, in the same order, with the same message set, so it is still the authoritative bridge list (CLAUDE.md, doc 09).Extracted functions (lines in the new
src/config_ui/main.cpp)OnReady()readyOnSetConfig(wv, j, type)setConfig,setConfigPersistOnSaveSession(wv)saveSessionOnDiscardSession(wv)discardSessionOnWindowAction(wv, j)windowOnPickExe(wv)pickExeOnOpenIni()openIniOnExportDiagnostics()exportDiagnosticsOnCreateProfile(wv, j)createProfileOnDeleteProfile(wv, j)deleteProfileHandleWebMessageis now 38 lines (473-510). Left inline on purpose:getConfig,dirty,switchProfileandopenRepoare one or two statements each; a function would add nothing.Move-only
Each extraction is its own commit, made by a script that cuts the branch body, removes 4 spaces of indent and wraps it in the new function; the branch keeps only the call. Comments travel with their code. The only early returns (
setConfigrefusing an unsafe key, a failed write) are now returns fromOnSetConfig, which is equivalent because nothing runs after the chain.discardSession'sIniWriteLockstill spansPostConfig.Checked with a moved-lines diff: sorting the removed and added lines of
git diff origin/mainwith indent stripped, the only differences are the 10 call lines, 10 signatures and 10 closing braces (plus a 2-line header comment and the doc 09 pointer in the last commit). Review withgit diff --color-moved --color-moved-ws=allow-indentation-change.Gates
build.bat check: exit 0build.bat test: exit 0 (643/643 test cases)build.bat: exit 0build.bat config(afternpm ci): exit 0npx playwright test: 205 passedDocs:
docs/architecture/09-settings-ui.mdnow says the list is the dispatch chain, with the handlers just above it.🤖 Generated with Claude Code
https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH