michael / michael/svedit

Introduce global and scope/context-aware ClipboardHandler and SelectionHandler

Open
#175 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
675
Forks
18
Avg merge
5h 11m
Merged PRs (30d)
1

Description

Much like I introduced KeyMapper (change to KeyboardHandler? or KeydownHandler) Svedit should have just a single handler to mange selection changes or clipboard events (copy, cut, paste), this handler must be aware of the current context, so just like the KeyMapper track a scope_stack, so we have an app on top level and once we focus a Svedit instance it registers a new svedit-aware scope to take over the handling.

In other words I should get rid of these global event handlers in Svedit.svelte:

<svelte:document {onselectionchange} {oncut} {oncopy} {onpaste} />

Example scenario:

You have an app, that has some selection & copy&paste handling on app level, when no svedit instance is active. E.g. think of a side-panel that manages website design parameters, e.g. Fonts. And then when when you paste a font into that area, you should be able to hook into that paste handler, while any Svedit instance's handler should do nothing (as they are not in focus).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Svedit.svelte and the existing KeyMapper implementation, especially how its scope_stack is managed. Replace the document-level selection and clipboard handlers with a global, scope-aware design; done means app-level handlers work when no Svedit instance is active and the focused Svedit scope takes over.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.