Bug 342094 - State of side Navigation Panel is not not remembered
Summary: State of side Navigation Panel is not not remembered
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.20.3
Platform: Fedora RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2014-12-21 21:29 UTC by Sudhir Khanger
Modified: 2022-02-14 14:05 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sudhir Khanger 2014-12-21 21:29:48 UTC
I use Thumbnail in Navigation Panel. When I close and open Okular, it always open Contents and no Thumbnail of the page where I am in the PDF.

Reproducible: Always

Steps to Reproduce:
1. Open a PDF
2. Go to some random page, switch to thumbnails  in navigation panel
3. close and reopen the pdf

Actual Results:  
always opens in contents in navigation panel

Expected Results:  
If I close the okular with thumbnail view in navigation panel when okular is opened again it should have thumbnail view in navigation panel on the page i was reading before.
Comment 1 thekswenson 2015-01-16 14:57:49 UTC
I would like to add that the same thing happens when a watched file is refreshed.
This is extremely annoying when Okular is used to view a PDF that is being regularly updated by a tool like pdflatex.
The user must reclick on the thumbnails tab every time a change is made!
Comment 2 Albert Astals Cid 2015-01-16 22:38:40 UTC
@thekswenson that's a different bug, i'm not convinced the state of the side panel has to be remembered when opening/closing okular, but reloading is defenitely a bug, please open a different bug so it can be tracked separately
Comment 3 thekswenson 2015-01-20 16:12:25 UTC
the state of the side panel should be saved on a per document basis.  when i re-open a PDF it comes back on the same page and the same line that i closed it at.  why shouldn't the panel be in the same state too (and at the same thumbnail, etc., that it was left at)?

i'll open a new bug anyway.
Comment 4 azrdev 2017-03-22 11:40:07 UTC
I'd be especially interested in the sidebar retaining its "no panel open" state across okular restarts.
Comment 5 Armin 2017-05-31 00:00:17 UTC
I can second the request to retaining the "no panel open" state across okular restarts. This is probably the most annoying bug in KDE I am struggling with every day!

Just to note, this seems like a duplicate of: https://bugs.kde.org/show_bug.cgi?id=335189
Comment 6 Armin 2017-05-31 00:06:59 UTC
Also in this bug the feature was requested, but prematurely dismissed by Albert Astals Cid due to bug reporting formalities:
https://bugs.kde.org/show_bug.cgi?id=355530
Comment 7 toon.pepermans 2019-07-14 11:07:20 UTC
I am simply astonished something like this hasn't been implemented years ago. It can't be difficult: Okular can remember whether the navigation panel was open or not in the last session, and Okular can remember the position and even zoom of a specific document. Now it has to be a simple step to add "ShowLeftPanel=false" or "ShowLeftPanel=true" to the xml files in /home/user/.local/share/okular/docdata
In those files there already is something like:
  <views>
   <view name="PageView">
    <zoom value="1.25" mode="0"/>
   </view>
  </views>"
While in /home/user/.config/okularpartrc I find:
 [Main View]
 ShowLeftPanel=false
(when the navigation panel is open, however, there isn't "ShowLeftPanel=true", but just nothing, maybe this should change)
Why not add this to the individual document files? I tried to change an xml file myself, but that didn't work.
The next step (I suppose more difficult) is to remember which of the panels (thumbnails or contents) was opened.
All this is standard behavior in Adobe Acrobat Reader DC on Windows 7, do you think Adobe is getting lots of angry emails about this? It's also standard behavior on the new WPS pdf reader.

Just to make clear my personal user case: I generally read pdf text files (or djvu or epub, thank you very much for adding these file types to Okular), so the thumbnails panel is mostly useless for me. The contents panel is very handy however, but not every pdf has contents, and sometimes these 'contents' are IMG_0001, IMG_0002, etc. In those cases I don't need a navigation panel at all. So Okular remembering for each file if the panel was open or not is very useful to me.
Comment 8 Nathan Colinet 2021-01-07 10:22:43 UTC
I really like okular and I want to get involved in KDE so this looks like a great starting point :)
Comment 9 Andrea Ippolito 2021-09-26 09:11:57 UTC
I'm not really sure this is a junior job.

I haven't downloaded the code yet, but checking:

https://github.com/KDE/okular/blob/1dc81340bcfecf054f27c17279cb241316a7c16c/core/document.cpp

it seems to me that the code that handles per-document properties is not the right place to handle app UI properties, I guess this was by design.

I also dunno exactly what are the rendering steps once a document is opened in okular: I would guess that first the app UI is rendered, with or without left panel depending on the "global" settings persisted in:

~/.config/okularpartrc

And only once the "frame" is in place, document rendering takes place, according to its specific view settings (persisted on a document basis).

So IMO to achieve what's requested by the logger, this process should be reviewed, either by delaying rendering of part of the app UI, or by drawing it with some defaults/global state, and then re-draw the left panel according to per-document settings, if any are stored (which could cause some re-rendering glitches, I guess?)

Also, I dunno whether left panel properties (on/off and tab id) could be stored in the per-document XML file within a <view name=LeftPanel> element, for example.

Is there an XSD defining the structure of documentInfo?

<documentInfo url="/home/andrea/Documents/Casa/Diagnostiques/2043 (DIAG ELEC).pdf">
 <generalInfo>
  <history>
   <oldPage viewport="0;C2:0.499767:0.209379:1"/>
   <current viewport="3;C2:0.499803:0.545531:1"/>
  </history>
  <views>
   <view name="PageView">
    <zoom mode="1" value="2.47816"/>
    <continuous mode="1"/>
    <viewMode mode="0"/>
    <trimMargins value="0"/>
   </view>
  </views>
 </generalInfo>
</documentInfo>
Comment 10 Albert Astals Cid 2021-09-26 16:42:26 UTC
(In reply to andrea.ippo from comment #9)
> I'm not really sure this is a junior job.
> 
> I haven't downloaded the code yet, but checking:
> 
> https://github.com/KDE/okular/blob/1dc81340bcfecf054f27c17279cb241316a7c16c/
> core/document.cpp
> 
> it seems to me that the code that handles per-document properties is not the
> right place to handle app UI properties, I guess this was by design.
> 
> I also dunno exactly what are the rendering steps once a document is opened
> in okular: I would guess that first the app UI is rendered, with or without
> left panel depending on the "global" settings persisted in:
> 
> ~/.config/okularpartrc
> 
> And only once the "frame" is in place, document rendering takes place,
> according to its specific view settings (persisted on a document basis).
> 
> So IMO to achieve what's requested by the logger, this process should be
> reviewed, either by delaying rendering of part of the app UI, or by drawing
> it with some defaults/global state, and then re-draw the left panel
> according to per-document settings, if any are stored (which could cause
> some re-rendering glitches, I guess?)
> 
> Also, I dunno whether left panel properties (on/off and tab id) could be
> stored in the per-document XML file within a <view name=LeftPanel> element,
> for example.
> 
> Is there an XSD defining the structure of documentInfo?
> 
> <documentInfo url="/home/andrea/Documents/Casa/Diagnostiques/2043 (DIAG
> ELEC).pdf">
>  <generalInfo>
>   <history>
>    <oldPage viewport="0;C2:0.499767:0.209379:1"/>
>    <current viewport="3;C2:0.499803:0.545531:1"/>
>   </history>
>   <views>
>    <view name="PageView">
>     <zoom mode="1" value="2.47816"/>
>     <continuous mode="1"/>
>     <viewMode mode="0"/>
>     <trimMargins value="0"/>
>    </view>
>   </views>
>  </generalInfo>
> </documentInfo>

I think you didn't understand what the user wants at all, they only want that if the last time they were open a document it was on thumbnails, open again in thumbnails not in contents, there's no need for changing anything render related *at all*.

The only question is if would do this globally or per file, but that only means the setting is change in one place or the other.
Comment 11 Nathan Colinet 2022-02-07 13:44:41 UTC
It's been a while, but I've got something working. I've done it globally but I'm not sure it's very useful... Per file may makes more sense. What do you think?
Comment 12 Albert Astals Cid 2022-02-14 14:05:56 UTC
Yes, probably per file makes more sense.