Repository navigation
refactor(algorithm-panel): split into algorithm-selection and experiment-result sections - #63
Open
KFilippopolitis wants to merge 8 commits into
Open
KFilippopolitis wants to merge 8 commits into
KFilippopolitis wants to merge 8 commits into
Conversation
Needs and readiness text, availability tooltip text, catalog filtering and group collapsing, tooltip placement, parameter schema enrichment, form building and value normalization, and run naming for cross-validation are plain functions now, each with a spec. The panel calls them; behavior is unchanged. One number-step rule (allowsDecimal) replaces the copy in the template and the copy in the integer validator.
The panel's 28 any are gone: parameters are AlgorithmParameterField / EnrichedParameterField, studio variables StudioVariable, outlier rows OutlierReportVariable, the tooltip holds an AlgorithmConfig and the export run info is ExperimentRunInfo. Option labels go through optionLabel instead of an untyped template expression, and the outlier enable checkbox reads a template reference instead of $any($event.target). experimentInfo no longer builds a preprocessingSteps list nothing read.
Outlier rules and errors, the built-form signature and the last run algorithm become signals; category collapse becomes a linkedSignal; outlierReportRuleFor is a pure read; unused formKey removed.
AlgorithmCatalogService owns search, filter, group collapse and availability; AlgorithmConfigFormService the parameter form, cross-validation and outlier rules; AlgorithmRunService run requirements, the run and the exports; AlgorithmStudioSubstepService the sub-step behind studioSubstepChange. The panel delegates its public API to them. Unused yVar, xVar, selectedVariables, isAlgorithmAvailable and SessionStorage removed. Service-level spec cases move to service specs.
section[app-algorithm-selection] holds the card; aside[app-algorithm-catalog], section[app-algorithm-parameters], section[app-outlier-report-editor], div[app-algorithm-config-field] (typed field input, replaces the untyped ng-template) and div[app-algorithm-availability-tooltip] attach to the elements they render into, so the DOM, anchors and selectors are unchanged. Each rule moves to the sheet of the template its element lives in; rules several sheets share move to styles/*.shared.css partials. The panel sheet drops from 22.1 kB (over budget) to 3.7 kB.
div[app-experiment-result] renders the readiness bar the panel projects into the card (is-ready as a host binding); ul[app-algorithm-run-requirements] renders the run needs and resolves their actions. Both read AlgorithmRunService, which owns the run, its error and the exports.
…p and tidy the run flow - showTooltip had no caller, so the tooltip component, its position helper, catalog tooltip state, .tooltip CSS, availabilityRequirementText and formatInputCountRange are removed with their specs - runExperiment checks the algorithm before touching run state and no longer clears the error three times - the requirements action scrolls inline instead of through a one-use helper
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.
Splits the algorithm panel the way Data Handling was split in #56: a thin
app-algorithm-panelshell, attribute-selector sections, and services that the panel provides to its sections. Nothing should look or behave differently.Structure
algorithm-panel(shell, 64 lines): same selector, same wiring, and the same API the studio calls (canRun,runDisabledReason,onClickRunExp,setStudioSubstep,studioSubstepChange,onExportResult,onExportResultZip). It provides the services and lays out the card, the readiness bar and the tooltip.algorithm-selection/section[app-algorithm-selection]: the card, which hosts role assignment and the details/documentationaside[app-algorithm-catalog]:#algo-search, groups and Runnable/Allsection[app-algorithm-parameters]div[app-algorithm-config-field]: replaces the untypedng-templatewith a typedfieldinputsection[app-outlier-report-editor]div[app-algorithm-availability-tooltip]experiment-result/div[app-experiment-result]: the readiness bar and errorul[app-algorithm-run-requirements]AlgorithmCatalogServiceAlgorithmConfigFormService: the form, cross-validation, positive_class and the outlier_report rulesAlgorithmRunService: run needs, the run, the error and the PDF/ZIP exportAlgorithmStudioSubstepServiceutils/with specs, and shared types are inalgorithm-panel.models.ts.algorithm-result/(shared).Cleanup
any→ 0.linkedSignal.outlierReportRuleForis now a pure read. It used to write during render.formKey,yVar,xVar,selectedVariables,isAlgorithmAvailableand the SessionStorage injection.styles/*.shared.css. The panel sheet went from 33.2 kB of source (it tripped the budget warning) to 3.3 kB. Every sheet is now under the 20 kB warning, and the warning is gone.Unchanged
data-guideanchors (experiment-workspace,algorithm-selection,algorithm-settings)#algo-searchand all other e2e selectorsVerification
npm run verify: passes (no dead code; the only warning is the existing jszip one).Follow-ups and open questions
valueChanges/statusChanges, so later edits are not persisted andformInvalidgoes stale.showTooltip, so the availability tooltip can't be reached from the UI. Remove it or wire it up?ALGORITHM_PANEL_EXCLUDED, so its editor only shows for a restored session or edit flow.