Skip to content

fix: validate shortcut filename when URL is pasted - #3356

Open
AlexAndBear wants to merge 2 commits into
mainfrom
fix/create-shortcut-name-validation-3328
Open

fix: validate shortcut filename when URL is pasted#3356
AlexAndBear wants to merge 2 commits into
mainfrom
fix/create-shortcut-name-validation-3328

Conversation

@AlexAndBear

Copy link
Copy Markdown
Member

Description

This bugfix makes Create Shortcut use the shared filename validator and fixes the missing inline error state after URL paste.

  • Reuses useIsResourceNameValid for shortcut filename validation.
  • Prevents invalid shortcut names from being submitted when URL paste auto-fills the filename.
  • Keeps the filename input mounted while hidden so the inline error message appears immediately when the auto-filled name is invalid.
  • Uses the shared validation result for both inline error text and confirm-button disabled state.

Related Issue

How Has This Been Tested?

  • test environment: local dev environment on macOS
  • test case 1: paste a URL into Webpage or file without using the suggestion popup and verify invalid auto-filled filename shows an inline error and keeps Create disabled
  • test case 2: provide a valid URL and valid shortcut name and verify Create is enabled
  • test case 3: pnpm test:unit --run packages/web-pkg/tests/unit/components/CreateShortcutModal.spec.ts
  • test case 4: pnpm check:types

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@github-project-automation github-project-automation Bot moved this to Qualification in OpenCloud Team Board Sep 12, 2026
@AlexAndBear AlexAndBear moved this from Qualification to In Progress in OpenCloud Team Board Sep 12, 2026
@AlexAndBear AlexAndBear self-assigned this Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Creating a shortcut lets you submit a invalid name

1 participant