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

Copy link to Paragraph can copy from the wrong instance of OneNote (as does XML view) #1563

Open
jasonjac2 opened this issue Aug 30, 2024 · 18 comments
Labels
bug Something isn't working onenote-bug Internal OneNote bug, needs Microsoft input

Comments

@jasonjac2
Copy link

jasonjac2 commented Aug 30, 2024

Problem to Solve

I have 8 OneNote windows open. I use OM copy link to paragraph from a window. If there is another windows that has the same page open (which is often the case), the copy Link to Paragraph MAY copy the one from the wrong windows (not the one I am on).

The impact is the link has the wrong text and takes you to the wrong part of the page. This can be very confusing.

It does the same thing with the "XML viewer", i.e. the XML will show the selection as the one from the wrong window.

I haven't done any additional testing, but my assumption is, it is either using the first instance that has the correct page open (instead of the one with focus).

I think I noticed it a couple of versions ago, but only just realised when it happens as it take a certain set of circumstanced.

I have tried on 2 different PCs with different pages. You can show the problem with just 2 instances of OneNote.

Steps:

  • Open Onenote
  • Goto a page with headings (longish)
  • Click into a para
  • Open a second instance of onenote (ctrl+m) on the same page
  • Goto a different part of the page (so that you would have to scroll to get to the 1st part).
  • click into a para
  • On the second instance, "copy link to para"
  • Paste this somewhere (word / the page you were on in the second instancet)
  • Note the text of the link will show the para from the 1st instance
  • Click the link
  • It will take you to the part of the page the 1st instances cursor was.

Environment (if applicable)

Version 6.5.1 with OneNote 16.0.17928.20114

Additional Context

THE FINE PRINT This is a hobby project that I started for myself. I'm happy to take requests and will promise to
consider each one carefully but offer no guarantees that I will ultimately agree to their
usefulness or have time to implement any of them. If OneNote offers a "close enough" work-around
then I will probably reject the request - you've been warned!

@jasonjac2 jasonjac2 added bug Something isn't working unread I have seen it or had time to refine it yet labels Aug 30, 2024
@jasonjac2
Copy link
Author

I have added steps to the 1st post to make it clear how to reproduce.

@jasonjac2
Copy link
Author

I was just doing system documentation so had 2 virtual desktop (i.e. one W11 PC with 2 virtual desktops). I was on the 2nd desktop and was copying links to a para and then pasting into another instance. Because I was on the same page on the main virtual desktop, it kept copying the same link regardless of where I was on the page :-).

@stevencohn stevencohn removed the unread I have seen it or had time to refine it yet label Sep 2, 2024
@jasonjac2
Copy link
Author

Have you managed to reproduce this / have you had time to look?

@stevencohn
Copy link
Owner

TBH I haven't tried. But TBH, I believe you and can envision exactly why it would happen. Solutions might include:

  1. Take advantage of a known ID on each page (the omID I've introduced in other areas) and rely on that for a unique page identifier instead of the OneNote pageId.
  2. Find a simpler way to identify the same page across instances or even machines
  3. Restrict command to single window instances; this is not the most user friendly

@jasonjac2
Copy link
Author

From your reply, I'm not sure I have described it quite right - is the issue clear? i.e. it is like when your command asks ON for the current page, it is given the wrong one. I am not sure how the system decides how to ask for a page.

I can't see 1 working as it is exactly the same page, it is just I invoked the "copy para to clipboard" from another instance. So it would have the same ID?

When a command is invoked, how does it know what page it was invoked from and how does it know which instance (which active window) it was invoked from?

@stevencohn
Copy link
Owner

Yes I can reproduce it

@jasonjac2
Copy link
Author

This has bitten me a few times in the last week..... I have been reviewing a large project and putting in links on various pages to various other pages to make it easier for a novice to consume. Having a bunch of pages open and editing, putting links all over the place. I realised that on another virtual desktop I had an instance on ON open and on the main page I was referencing. The outcome was a bunch of "random" links to the main page throughout the notes...... Just enough to convince a newbie I was off my rocker and trying to confuse them more :-).

Also, came across another expression of the project: #1585

Cheers for all the hard work.... still building up to setting the environment to build this.

@jasonjac2
Copy link
Author

Bitten again - Doing documentation for a project, one page with bits of development, project mgmt. Pulling together references for a meeting. All on muscle memory. Reviewed my list on links and one liners, only to find all the reference links pointed to the same para on the source page :-(.

Dev: Did refresh my fork and opened solution, got the first set of requirements, but wouldn't compile - as expected as I hadn't completed the pre-req's for compile..... but then ran out of time. As an aside where should i be looking for the "get the XML for the current page with this name", which is where I assume the issue lies.

@stevencohn stevencohn added the onenote-bug Internal OneNote bug, needs Microsoft input label Oct 29, 2024
@stevencohn
Copy link
Owner

stevencohn commented Oct 29, 2024

Hi @jasonjac2. I believe this to be an internal problem with the OneNote API. After opening up two windows viewing the same page, the API thinks the context is the first window. It's not until you modify the page content in a secondary window will OneNote set the context of the API to that window. You can replicate this just using the Show XML command as you suggested.

@jasonjac2
Copy link
Author

Hi @stevencohn I can't replicate this, i.e.

  • 2 instances on same page, caret at different points in page.
  • 3rd instance on a new page
  • Reproduce the issue, 2nd instance right click | copy link to para
  • goto 3rd instance and paste - link is to caret on 1st instance.
  • Edit 2nd instance -I added a space 1st time and a couple of carriage returns the second time
  • redo test, you still get the link to the 1st instance.
    Version 6.5.1 with OneNote 16.0.18025.20160

@jasonjac2
Copy link
Author

@stevencohn so on this one, it looks like for me the editing of the page "flipping" ON into realising which the current Instance of a page doesn't actually make any difference. For me, it is predictable which instance it will use, based on (I think) the either the ordering of them being opened OR the order of them on the taskbar (when I press the ON icon on the taskbar and it shows me n instances).
I know MS are not very responsive, but do you know if it s a known bug? If not can you / we raise a bug report?

@jasonjac2
Copy link
Author

@stevencohn I've just replicated the issue in OneTastic's XML view, not that I was doubting you :-).
So work around and get fixed...
Get Fixed: It looks like the only way is to get stuff on "Feedback" and get it upvoted into the thousands.. I will add something there, but get the text right here first so it is as clear and concise as possible.
OneNote Feedback: (https://feedbackportal.microsoft.com/feedback/forum/c06dcc30-2e1c-ec11-b6e7-0022481f8472)
Work Around: when you run a command using a selection on a page - detect the number of OneNote instances and report duplicates of the page you are on (even if just by title) - it could be a warning bubble. Is that possible?

@stevencohn
Copy link
Owner

Yes, that's possible

@jasonjac2
Copy link
Author

I would count that as a weak bite. Kind of like my answer to questions in development meetings "anything is possible". :-)

@stevencohn
Copy link
Owner

Ha! Yes it's quite possible and easy enough to add to the next release. Better?

@jasonjac2
Copy link
Author

thats the best answer, thank you. I was warming up my VS to complete the build pre-requisite.
I always have my OneNote in position 1 on my taskbar and always have 3 virtual up and running (Admin / Dev / Dev Evaluation [the last one is blank most of the time]). Similar for outlook (position2). So my goto keyboard shortcuts are:
Win+1 (1 to 5 times as I normally have 5 instances up)
ctrl+win+left and right to switch desktops
When in ON:
alf+F (favs)
shift+ctr+P (pallette as I can never remember any others)
ctrl+E
ctrl+F

If you are going to build a structure for instances & active pages on those instances, can you consider in the architecture grabbing dekstop | position | Max/Min or make it so that the structure can be enhanced to get these, then the next step to a large thumbnail for all instances on all desktops and hotkeys to goto them immediately would be a smaller step for someone to develop.

Thanks again for entertaining my brain guff.

Also, can you give me concise wording to raise in a MS eedback that explains the problem?

@stevencohn
Copy link
Owner

stevencohn commented Nov 23, 2024

I entered a question myself here

@jasonjac2
Copy link
Author

I didn't even know https://learn.microsoft.com/ was a thing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working onenote-bug Internal OneNote bug, needs Microsoft input
Projects
None yet
Development

No branches or pull requests

2 participants