Bug 178352 - [Webapp] Sync with toc doesnt work with anchors
Summary: [Webapp] Sync with toc doesnt work with anchors
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows Vista
: P2 normal (vote)
Target Milestone: 3.3 RC2   Edit
Assignee: Adam Archer CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-03-20 13:48 EDT by Curtis d'Entremont CLA
Modified: 2007-06-11 10:00 EDT (History)
2 users (show)

See Also:
curtispd: review+


Attachments
fixed (1.17 KB, patch)
2007-05-17 20:06 EDT, Adam Archer CLA
no flags Details | Diff
Test cases (3.92 KB, application/x-zip-compressed)
2007-05-18 13:50 EDT, Chris Goldthorpe CLA
no flags Details
fixed properly (1.54 KB, patch)
2007-05-18 14:50 EDT, Adam Archer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis d'Entremont CLA 2007-03-20 13:48:37 EDT
I20070320-0010

- In the Help window, open Workbench User Guide > What's new
- Click on the Platform Changes link in the document
- Sync with toc

Bug: It thinks the doc isn't in the table of contents because we navigated to an anchor in a document.

This seems to work ok in the help view, probably because it tries stripping the anchor part of the url if it can't find the document with the anchor.
Comment 1 Chris Goldthorpe CLA 2007-05-15 16:10:06 EDT
Adam, could you look at this? It would be nice to get this into Eclipse 3.3 - it seems to happen fairly frequently.
Comment 2 Chris Goldthorpe CLA 2007-05-17 14:17:38 EDT
I've seen this a few times myself just in the last week. We should fix for 3.3 if possible, I expect the fix to be low risk.
Comment 3 Adam Archer CLA 2007-05-17 20:06:17 EDT
Created attachment 67747 [details]
fixed

This patch simply removes any anchor from the link before finding the toc path. I originally tried searching with the anchor and then without (to provide support for toc entries with anchors in the URL), but that proved to be a much more complex change. If that functionality is desired it should be addressed in 3.4.
Comment 4 Chris Goldthorpe CLA 2007-05-18 13:50:46 EDT
Created attachment 67837 [details]
Test cases

I just created a simple test case, which is a TOC containing three pages containing anchors, Page1 and Page2#A2 are in the TOC, Page 3 is not in the TOC.

Before your patch Show in TOC worked for Page1 and Page2#A2, after the patch it worked for Page1, Page1#A1, Page1#A2 and Page1#A3, but not for Page2#A2.

While I don't think use of anchors in the TOC will be common it would be better if all of the cases that used to work still worked. Can you take a look at this again to see if it is possible to get Page2#A2 working again, or better still get all of the Page2 cases working.
Comment 5 Adam Archer CLA 2007-05-18 14:50:10 EDT
Created attachment 67847 [details]
fixed properly

I figured out a simple way to achieve the functionality I was originally hoping for. This patch should provide support for all cases regarding anchors including the one discussed in comment #3.

The toc will be searched with the anchor text and if a reference is not found it will be searched again without.
Comment 6 Chris Goldthorpe CLA 2007-05-18 15:08:31 EDT
+1 from me, requesting approval from Curtis also. My testing indicates that the Webapp now matches the Help View as far as which cases work for Show in TOC.
Comment 7 Curtis d'Entremont CLA 2007-05-18 15:18:30 EDT
Patch looks safe.
Comment 8 Chris Goldthorpe CLA 2007-05-18 15:31:59 EDT
Patch committed to HEAD.
Comment 9 Adam Archer CLA 2007-06-11 10:00:57 EDT
Verified in I20070608-1718.