Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier to work with elements that reference one or more IDs #111

Open
maxrothman opened this issue Aug 31, 2024 · 4 comments
Open
Labels
feature request Wanted new functionality

Comments

@maxrothman
Copy link

Is your feature request related to a problem? Please describe.
There are lots of parts of the MEI spec where an attribute value contains references to one or more elements. For example in my project, we're using @data on children of editorialDecls to relate editorial decisions to the changed elements. Collecting these ID lists to put in those attributes is frustrating and error-prone, especially when the list contains more than a few elements. The currently-available workflow looks like this:

  • Starting at the attribute that will contain the ID list, locate the first target element and copy its ID
  • Scroll back to the ID list attr and paste the ID in
  • Find the next target elements. Make sure you don't copy the same one again
  • Scroll back. Oh whoops, you added the ID to the wrong list
  • Fix that, locate the next target element...

Describe the solution you'd like
I don't have a specific solution in mind, I'd just like to see this workflow get smoother. To start the conversation, here's a few ideas I brainstormed:

  • Putting the editor in a particular mode or holding down a key and then clicking an element in the rendered view causes that element's ID to be inserted at the current cursor position
  • mei-friend supports displaying two synced editor panes side-by-side, so a user could scroll through the document and pick out the element Ids they're looking for one one, then paste them into the target attribute in the other without having to scroll back and forth.
  • mei-friend adds a bookmark system, making it easier to jump back to the id list attr again and again
    • This doesn't make it easier to locate the next target element though
  • Hovering on an ID in an ID list shows a tooltip of the element it references with a few surrounding lines of context
  • mei-friend adds a more powerful search pane with filtering on XML attributes where you can form your search then pick out the elements in question

I hope these get the conversation going!

@wergo wergo added the feature request Wanted new functionality label Sep 3, 2024
@wergo
Copy link
Member

wergo commented Sep 4, 2024

This is an interesting request. Actually, exactly this situation was the original motivation for me to work on mei-friend (back then as plug-in package for the Atom editor): when adding a slur, you have to do this as well (select two different ids to add them at a different place in the editor).

Just to clarify your use case: You are talking about ids of elements that are not necessarily clickable/selectable in the notation pane?

One easier solution (referring to you second bullet in your solution list) could be to split the editor pane, using this CodeMirror5 functionality: https://codemirror.net/5/demo/buffers.html. This would help to keep two different locations in the editor in sight and copy/paste things easier around.

Or we could think about a mode where you click on different elements in the notation or in the editor pane and the ids of these elements are concatenated in the clipboard (or somewhere else) to later insertion.

@maxrothman
Copy link
Author

Wow! Thanks for all your work on this tool.

Just to clarify your use case: You are talking about ids of elements that are not necessarily clickable/selectable in the notation pane?

Correct, in particular, editorial elements that wrap rendered notation elements such as <supplied>, <reg>, etc. and header elements like the children of <editorialDecl>.

One easier solution...could be to split the editor pane, using this CodeMirror5 functionality...

That's certainly a compelling idea. It would require migrating to CodeMirror 5, which is probably a good idea anyways, but would definitely be a nontrivial change.

...a mode where you click on different elements in the notation or in the editor pane...

That would address this specific issue, but my instinct is that having a smaller number of more general tools (like search and split panes) is better than a larger number of more specific tools.

Part of the reason I didn't suggest a specific solution for this request is that I personally am having trouble understanding what solution would be best for mei-friend's target users. I know what I would do in my code editor of choice (VSCode) and something more like the Atom plugin you mentioned: I'd write a slightly complicated regex to do a search, open the search results in a separate buffer, multi-cursor select all the IDs, then paste them into the header element having never scrolled away from it. But that approach only works because I'm using a powerful featureful editor that I'm spent years getting good at using, know regex, etc. etc. Part of the entire value prop of mei-friend is that it's accessible to less technical users, and I think those users need different approaches that meet them at their level of technical skill. It's definitely an interesting usability problem!

@wergo
Copy link
Member

wergo commented Sep 9, 2024

We are already using CodeMirror 5 (the new/current one is version 6), so implementing a split screen for the same encoding document should be straightforward. We just would have to think about the required UI elements.

The other point you raised, is a request that we got from some of the MEI community: have mei-friend as an extension for VSCode. We would have all the strong features that VSCode offers (code validation, editing, GitHub integration, etc.), and have the special ones that mei-friend adds (such as notation display, MIDI playback, annotation and markup highlighting, facsimile etc). However, this would require a substantial re-work of the entire codebase to modularize it in a way that part of the mei-friend code could go into the VSCode extension and the other is to have mei-friend as stand-alone app on the Web. If you have ideas how to design and achieve this, please tell us.

@maxrothman
Copy link
Author

I'm not super well-versed with mei-friend's code, but frankly I'm skeptical about the idea that there's some core of mei-friend's functionality that could be generalized to produce a web UI and a VSCode extension. The platforms and UI needs are too different. I think it's possible that there might be some common libraries that could be extracted, but some of them probably already exist (e.g. verovio for notation rendering) so there's not much for mei-friend to do there. I suspect that a VSCode extension would be best attempted as a wholly new project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Wanted new functionality
Projects
None yet
Development

No branches or pull requests

3 participants
@maxrothman @wergo and others