Skip to content

Fix default Open action for .url files and add Text Editor support - #3266

Merged
AlexAndBear merged 2 commits into
mainfrom
fix/url-open-default-handler
Aug 31, 2026
Merged

Fix default Open action for .url files and add Text Editor support#3266
AlexAndBear merged 2 commits into
mainfrom
fix/url-open-default-handler

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Aug 29, 2026

Copy link
Copy Markdown
Member

Description

Before this fix, clicking "Open" on a .url file in the file-list context menu could result in no action at all.

Root cause: the rendered action was treated as a route link as soon as a route callback existed, even when that callback returned no target. In that case, the handler-backed action ("Open shortcut") was never executed.

What changed:

  • In ActionMenuItem, route/href targets are resolved first.
  • A route link is rendered only when route(...) returns a concrete target.
  • If no route target exists, the action falls back to button behavior and executes the handler.
  • .url is now also registered for the Text Editor, so shortcut files can be opened as plain text via "Open with".

Related Issue

  • Fixes N/A

How Has This Been Tested?

  • test environment: local dev environment (macOS, Node/pnpm workspace)
  • test case 1: pnpm --filter @opencloud-eu/web-pkg check:types
  • test case 2: pnpm test:unit --run packages/web-pkg/tests/unit/components/ContextActions/ActionMenuItem.spec.ts
  • test case 3: pnpm test:unit --run packages/web-app-text-editor/tests/unit/yjs.spec.ts packages/web-app-text-editor/tests/unit/app.spec.ts

Types of changes

  • Bugfix
  • Enhancement (a change that does not 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)

@AlexAndBear AlexAndBear self-assigned this Aug 29, 2026
@AlexAndBear AlexAndBear changed the title Fix default Open action for .url files and add Text Editor fallback Fix default Open action for .url files and add Text Editor support Aug 29, 2026
@AlexAndBear
AlexAndBear requested a review from kulmann August 29, 2026 19:54
@AlexAndBear

AlexAndBear commented Aug 29, 2026

Copy link
Copy Markdown
Member Author

@kulmann this bug has likely been around for quite a while. It appears to have been introduced when we improved the Open / Open with... context-menu actions.
At that time, Open was not shown for .url files in the context menu (see demo).

On current main, Open now appears for .url files (which is good), but we still need to make ActionMenuItem resolve the correct execution path when both handler and route are present.

That combination is an edge case coming from useFileActionsOpenWithDefault, and right now it can lead to Open not executing the expected handler.

Also added text editor support because I just felt like it 馃槑

@AlexAndBear
AlexAndBear force-pushed the fix/url-open-default-handler branch from e6171e5 to 04486af Compare August 29, 2026 20:09
@github-project-automation github-project-automation Bot moved this to Qualification in OpenCloud Team Board Aug 29, 2026
@AlexAndBear AlexAndBear moved this from Qualification to In Progress in OpenCloud Team Board Aug 29, 2026
@AlexAndBear
AlexAndBear force-pushed the fix/url-open-default-handler branch from 7303b28 to ee6fd39 Compare August 30, 2026 00:11
@AlexAndBear
AlexAndBear merged commit 86cc420 into main Aug 31, 2026
31 checks passed
@AlexAndBear
AlexAndBear deleted the fix/url-open-default-handler branch August 31, 2026 11:23
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenCloud Team Board Aug 31, 2026
@openclouders openclouders mentioned this pull request Aug 31, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants