Skip to content

frontend: kraken: Improve custom installation extension#3822

Merged
patrickelectric merged 2 commits intobluerobotics:masterfrom
nicoschmdt:improve-custom-installation-extension
Mar 10, 2026
Merged

frontend: kraken: Improve custom installation extension#3822
patrickelectric merged 2 commits intobluerobotics:masterfrom
nicoschmdt:improve-custom-installation-extension

Conversation

@nicoschmdt
Copy link
Contributor

@nicoschmdt nicoschmdt commented Mar 9, 2026

fix: #3127

Summary by Sourcery

Improve the extension creation modal UX for setting Docker tags and saving custom extensions.

New Features:

  • Allow saving a new extension from the creation modal using the Ctrl+Enter keyboard shortcut.
  • Automatically extract and populate the Docker tag from pasted values that include a repository-style prefix (e.g., image:tag) in the tag field.

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 9, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds keyboard shortcut and smarter paste handling to the Kraken extension creation modal, improving usability when entering Docker image tags.

Sequence diagram for keyboard shortcut submission in ExtensionCreationModal

sequenceDiagram
  actor User
  participant ExtensionCreationModal
  participant VuetifyDialog

  User->>VuetifyDialog: keydown ctrl+enter
  VuetifyDialog->>ExtensionCreationModal: keydown.ctrl.enter event
  ExtensionCreationModal->>ExtensionCreationModal: saveExtension()
  ExtensionCreationModal->>VuetifyDialog: close dialog on success
Loading

Sequence diagram for Docker tag paste handling in ExtensionCreationModal

sequenceDiagram
  actor User
  participant TagInputField
  participant ExtensionCreationModal

  User->>TagInputField: paste docker_image:tag
  TagInputField->>ExtensionCreationModal: paste event
  ExtensionCreationModal->>ExtensionCreationModal: handleTagPaste(event)
  ExtensionCreationModal->>ExtensionCreationModal: extract tag part
  ExtensionCreationModal-->>TagInputField: set new_extension.tag to extracted tag

  User->>TagInputField: paste tag_only
  TagInputField->>ExtensionCreationModal: paste event
  ExtensionCreationModal->>ExtensionCreationModal: handleTagPaste(event)
  ExtensionCreationModal-->>TagInputField: leave pasted text unchanged (no match)
Loading

File-Level Changes

Change Details Files
Support saving the extension via Ctrl+Enter from the creation modal dialog.
  • Bind a keydown handler on the dialog to trigger saveExtension when Ctrl+Enter is pressed
  • Prevent default browser behavior for the Ctrl+Enter keyboard event to avoid conflicts
core/frontend/src/components/kraken/modals/ExtensionCreationModal.vue
Improve Docker tag input UX by parsing pasted image references and extracting only the tag portion.
  • Attach a paste event handler to the Docker tag v-text-field
  • Implement handleTagPaste to read pasted clipboard text
  • Detect when the pasted text looks like an image reference with a colon separator and extract the part after the colon as the tag
  • Prevent the default paste if the pattern matches and programmatically set new_extension.tag to the extracted value
core/frontend/src/components/kraken/modals/ExtensionCreationModal.vue

Assessment against linked issues

Issue Objective Addressed Explanation
#3127 Allow pasting a pull-request source branch name into the Docker tag field and automatically strip everything up to and including a colon, if present.
#3127 Move the save button in the custom Extension installation modal to the bottom right for consistency with the rest of the interface. The diff only adds a paste handler for the Docker tag field and a keyboard shortcut handler; there are no changes to the button layout or positioning of the save button.
#3127 Enable submitting the custom Extension installation form via keyboard (Enter or a modifier+Enter) instead of requiring a mouse click on the save button.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • The handleTagPaste regex ^[a-zA-Z0-9_-]+:(.+)$ is quite restrictive and won't match many valid image formats (e.g. with slashes, dots, or registries); consider broadening it (e.g. ^[^:]+:(.+)$ or a more Docker-specific pattern) so it works for typical repository-style prefixes.
  • In handleTagPaste, the captured group is stored in a variable named branch, which is confusing in the context of Docker tags; renaming this to something like tag would make the intent clearer and avoid mixing Git terminology with Docker concepts.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `handleTagPaste` regex `^[a-zA-Z0-9_-]+:(.+)$` is quite restrictive and won't match many valid image formats (e.g. with slashes, dots, or registries); consider broadening it (e.g. `^[^:]+:(.+)$` or a more Docker-specific pattern) so it works for typical repository-style prefixes.
- In `handleTagPaste`, the captured group is stored in a variable named `branch`, which is confusing in the context of Docker tags; renaming this to something like `tag` would make the intent clearer and avoid mixing Git terminology with Docker concepts.

## Individual Comments

### Comment 1
<location path="core/frontend/src/components/kraken/modals/ExtensionCreationModal.vue" line_range="308-312" />
<code_context>
         }, 2000) // Reset after 2 seconds
       }
     },
+    handleTagPaste(event: ClipboardEvent) {
+      const pastedText = event.clipboardData?.getData('text')?.trim()
+      if (!pastedText) return
+
+      const match = pastedText.match(/^[a-zA-Z0-9_-]+:(.+)$/)
+      if (match) {
+        const [, branch] = match
</code_context>
<issue_to_address>
**issue (bug_risk):** The Docker image regex is too restrictive and will miss common valid image formats.

This pattern only matches very simple `name:tag` forms and will reject valid image references with dots, slashes, or registry prefixes (e.g. `registry.gitlab.com/group/image:tag`, `my.registry.local/app/image:tag`). Consider making the match logic focus on the last `:` (after an optional digest separator) instead of constraining the repository part, for example by using a more permissive regex or `pastedText.lastIndexOf(':')` and slicing from there.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@nicoschmdt nicoschmdt force-pushed the improve-custom-installation-extension branch from 8c101c5 to 7e0ee21 Compare March 10, 2026 13:45
@patrickelectric patrickelectric merged commit 37b92e0 into bluerobotics:master Mar 10, 2026
7 checks passed
@nicoschmdt nicoschmdt deleted the improve-custom-installation-extension branch March 11, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core: frontend: kraken: improve custom Extension installation process

2 participants