feat(harness): SourcePicker Add Include context (Phase 3)#294
Merged
Conversation
Migrates the bespoke Add Include flow onto the unified SourcePicker, completing the picker plan for the three "add a thing" surfaces: Install Harness (Phase 1), Add Delegate (Phase 2), and now Add Include. Layout - Library tab lists plugins from configured marketplaces with search and "already installed" recognition. Picking a fresh plugin enters a Configure stage with the picks tree (IncludePicksSelector) and a command preview; clicking a row matching an existing include routes through to the editor's Edit sheet via switchToEditing(). - Git URL tab takes URL + ref + path with command preview (no picks — raw URLs aren't introspected; user can narrow with Edit afterwards). - Apply runs `ynh include add` via IncludeApplier; on success the editor's didFinishAddingInclude() dismisses the sheet and reloads detail. Sheet replaces the inline expansion. The "+ Add Include…" button now toggles editor.isAddingInclude which the IncludeEditorOverlay presents as a sheet (mirroring AddDelegateSheetHost). File layout - New: Sources/TermQ/Views/SourcePicker/AddIncludeContext.swift - New: Sources/TermQ/Views/SourcePicker/IncludePicksSelector.swift (extracted from the old flow file; reusable view) - New: Sources/TermQ/Marketplace/IncludeMatching.swift (IncludeKey + IncludePluginLookup; non-View utilities) - Deleted: Sources/TermQ/Views/AddIncludeFlow.swift (790 lines) - HarnessDetailDependencyView: drops AddIncludeSectionView; entry-point button stays; sheet host modifier added. Tests - AddIncludeStoreTests → AddIncludeContextTests, rewritten against the new context API. Covers library-stage resolution, picks helpers, and command-preview behaviour for both Library and Git URL paths. Localization - Retires step-title and source-mode strings (no longer needed — picker shell handles tab labels and step dots are dropped). - Adds harnesses.include.add.edit.existing. - All 40 locales synced.
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.
Summary
Phase 3 of the unified source-picker plan, completing the picker abstraction across the three "add a thing" surfaces:
SourcePickerThe bespoke 790-line
AddIncludeFlowretires in favour ofAddIncludeContextdriving the sameSourcePickershell as the other two contexts.Changes
New files
Sources/TermQ/Views/SourcePicker/AddIncludeContext.swift—SourcePickerContextfor adding includes. Library tab lists plugins from configured marketplaces with search and "already installed" recognition; picking a fresh plugin enters a Configure stage with the picks tree (IncludePicksSelector) and a command preview. Git URL tab takes URL/ref/path with the same Apply path. Inherits the post-pick Configure stage shape from Add Delegate.Sources/TermQ/Views/SourcePicker/IncludePicksSelector.swift— moved fromAddIncludeFlow.swift; reusable view kept for the Configure stage (and the existing Edit Include sheet which already uses it).Sources/TermQ/Marketplace/IncludeMatching.swift—IncludeKeyandIncludePluginLookupnon-View types moved here from the old flow file. Used by both the new context's already-installed detection and the existing Edit sheet.Modified
Sources/TermQ/Views/HarnessDetailDependencyView.swift— drops the inlineAddIncludeSectionView; "+ Add Include…" button now triggerseditor.startAddingInclude()which theIncludeEditorOverlaypresents as a sheet (mirrorsAddDelegateSheetHost).Sources/TermQ/Views/HarnessIncludeEditor.swift—isAddingIncludesemantics shift from "show inline panel" to "show sheet"; existingdidFinishAddingInclude(harnessName:)flips the flag and reloads detail.Sources/TermQ/Utilities/Strings+Sidebar.swift— addsharnesses.include.add.edit.existing; retires step-title and source-mode strings (no longer needed — picker shell handles tab labels and step dots are dropped).Deleted
Sources/TermQ/Views/AddIncludeFlow.swift(790 lines).Tests
Tests/TermQTests/AddIncludeStoreTests.swift→ renamed toAddIncludeContextTests.swift, rewritten against the new context API (15 tests covering library-stage resolution, picks helpers, command-preview behaviour for Library and Git URL paths).Localization
harnesses.include.add.step.*,harnesses.include.add.source.*).harnesses.include.add.edit.existing= "Edit") added across all locales.UX changes from the prior inline flow
editor.switchToEditing(match). Critical UX preserved.--pickdefaulting to all artifacts).AddInclude:log lines for diagnostic forensics.Test plan
--pick.--pick.skillsState != .eager; spinner shows; picks populate.🤖 Generated with Claude Code