Add credential and download gating to tool cards in notebook - #825
Open
Irozuku wants to merge 2 commits into
Open
Add credential and download gating to tool cards in notebook#825Irozuku wants to merge 2 commits into
Irozuku wants to merge 2 commits into
Conversation
…oads Add download and credential gating to the ToolList/ToolGrid explorer and converter cards, mirroring the model rows in the models sidebar. A card is blocked when a required credential is not authenticated or a required download is still pending, and clicking it resolves the blocker (opens the credentials dialog or starts the download) instead of opening the config. Emit requires_download/download_size_bytes in BaseConverter and BaseExplorer metadata so the frontend can detect downloadable explorers and converters, and extend the metadata tests accordingly.
Card level opacity/grayscale grouped the download and credential icons with the dimmed content, so a gated card greyed its own affordances. Dim the preview, icon and text individually and lift the status icons above the hatch overlay. Hover state now keys off `disabled` (dataset mismatch) instead of the full gate, so credential locked and not yet downloaded tools still show their description popover and hover animation.
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
Explorer and converter tool cards now gate on the same credential/download rules as the model rows in the models side bar. A tool that needs an authenticated platform credential opens the credentials dialog on click; one that needs a model download starts the download instead of opening the config form. Cards show a key icon and/or a download/spinner/delete icon for their state, and the icons stay in full color instead of inheriting the card's dimmed style. Backend exposes
requires_download/download_size_bytesin converter and explorer metadata so the frontend can gate on it.Type of Change
Changes (by file)
Backend
DashAI/back/converters/base_converter.py: emitrequires_download(fromREQUIRES_DOWNLOAD) anddownload_size_bytes(fromDOWNLOAD_SIZE_BYTES) in the converter metadata.DashAI/back/exploration/base_explorer.py: same two metadata keys for explorers.tests/back/converters/test_base_converter_metadata.py: new, asserts the metadata defaults and the declared attribute path.tests/back/exploration/test_base_explorer_metadata.py: new, same coverage for explorers.Frontend
DashAI/front/src/components/notebooks/tool/useToolGate.js: new shared hook. Combines dataset incompatibility (disabled), credential lock and download state intoblocked/gated/locked/requiresDownload, plus aresolve()that routes a click to the credentials dialog, the download start, or the normal use action.DashAI/front/src/components/notebooks/tool/ToolGrid.jsx: splitonClickintoonUse/onDownload/onNeedsCredentials, wirestartComponentDownloadandCredentialsDialog, and route the pending drag and drop tool through the same gate via a smallResolveDropchild (resolves once per dropped tool so a rerender can't restart a download or reopen the dialog).DashAI/front/src/components/notebooks/tool/ToolList.jsx: same handler split, download and credentials wiring, and gated drop resolution.DashAI/front/src/components/notebooks/tool/ToolGridItem.jsx: consumeuseToolGate; render the key icon andModelDownloadStatusIconin the card header; dim the preview, category icon and text individually instead of the whole card so the status icons keep their color, and lift them above the hatch overlay; hover description popover and lift animation now key offdisabledonly, so a credential locked or not yet downloaded tool still previews on hover.DashAI/front/src/components/notebooks/tool/ToolListItem.jsx: same gating and status icons for the list layout, with the icons kept outside the dimmed subtree and the slide animation restored for gated but not incompatible tools.