refactor(mqlaunch): de-layer fzf pickers into a lib (Step 11a)#42
Merged
Conversation
Second Step 11a slice. Pull the six fzf interactive pickers (git log/branch, kill process/port, run snippet, recent files) out of the mqlaunch.sh monolith into mqlaunch/lib/fzf-pickers.sh, sourced back into the launcher's scope. Verbatim move: the pickers still rely on the launcher's ambient UI helpers and $BASE_DIR, and every caller (main dispatch + command-mode's `declare -f … || fallback`) resolves because the lib sources before dispatch. No behavior change. The lib is pure bash (no zsh builtins), so it carries a bash shebang and is covered by shellcheck. Launcher: 1882 → 1771 lines. Generalise the de-layer guard: tests/network-lib-delayer-smoke.sh becomes tests/monolith-delayer-smoke.sh, a table-driven check over every extracted concern (network + fzf, 23 functions). It fails if any function is redefined in the monolith or a lib source is dropped, and picks the right syntax check (zsh -n vs bash -n) per lib shebang. Add a CONCERNS row per future extraction. AUTHORITY_MAP lists the new LIVE support lib; CHANGELOG updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Second slice of Step 11a (monolith de-layering, audit P4). Pull the six fzf interactive pickers out of
terminal/launchers/mqlaunch.shintomqlaunch/lib/fzf-pickers.sh:fzf_git_log,fzf_git_branch,fzf_kill_process,fzf_kill_port,fzf_run_snippet,fzf_recent_files.$BASE_DIR. No behavior change.mqlaunch.sh) and command-mode'sdeclare -f fzf_… || "$BASE_DIR/bin/mqlaunch" …fallback both run after the lib is sourced.#!/usr/bin/env bashshebang and full shellcheck coverage.Guard generalised
tests/network-lib-delayer-smoke.sh→tests/monolith-delayer-smoke.sh: one table-driven check over every extracted concern (network + fzf, 23 functions). For each it asserts the lib defines the functions, the launcher sources the lib, and the launcher redefines none — and pickszsh -nvsbash -nper lib shebang. Each future concern adds oneCONCERNSrow.Verification
Docs
docs/AUTHORITY_MAP.mdlists the new LIVE support lib;CHANGELOG.mdupdated.Part of the
v2.0.0runtime-authority track; 11a unblocks Step 12 (v1 removal).Note for a later, separate PR (not this one)
The launcher redefines
print_headerafter sourcingmq-ui.sh, shadowing the library's version — the two render different headers (launcher: dashboard-v7.1 script; mq-ui: bordered ASCII-face). That's a UI-authority reconciliation with a real behavior decision, out of scope for a verbatim de-layer. Flagging it rather than folding a behavior change into a refactor.🤖 Generated with Claude Code