Analogy-LogViewer / Analogy.LogViewer

A customizable Log Viewer with ability to create custom providers. Can be used with C#, C++, Python, Java and others
MIT License
303 stars 40 forks source link

Columns layout reseted after loading file #1494

Open pybride opened 1 year ago

pybride commented 1 year ago

Describe the bug

Columns layout isn't persisted between sessions

AnalogyGridlayout.xml is correctly saved after the columns layout modifications, with the expected VisibleIndex for each column. But it is overridden when re-opening the log file.

ℹ Computer information

📝 Provide detailed reproduction steps (if any)

  1. Open a log file (in my case a .clef)
  2. Change the order of columns in the grid (or rename one header in the option)
  3. Close the log tab
  4. Re-open the same log file

✔️ Expected result

Modified columns layout should be applied

❌ Actual result

Default columns layout is used

LiorBanai commented 1 year ago

Hi @pybride , I was not able to reproduce it. See below. Are my steps correct?

analogy_columns

LiorBanai commented 1 year ago

if you load it manually what do you see (via the more-->windows layouts): image

pybride commented 1 year ago

Hi,

It works when loading a specific Windows Layout (the name is a bit misleading for me, I didn't though that it will include the column order too). Your repro is correct, it may come from a change I didn't yet pushed.

In LogMessagesUC_Load, I added the following code near the beginning to correctly display my extension tab.

`BookmarkModeUI();

if (!string.IsNullOrEmpty(Settings.LogsLayoutFileName) && File.Exists(Settings.LogsLayoutFileName)) { string name = Path.GetFileNameWithoutExtension(Settings.LogsLayoutFileName); wsLogs.LoadWorkspace(name, Settings.LogsLayoutFileName); wsLogs.ApplyWorkspace(name); } LoadWorkspace(CurrentLogLayoutFileName);

await LoadExtensions();`

I don't understand how that modification would override AnalogyGridlayout.xml

LiorBanai commented 1 year ago

@pybride interesting. I'll check :)

LiorBanai commented 1 year ago

Maybe it worth adding description (super tool tip) to the button if it misleading

LiorBanai commented 1 year ago

@pybride Do you still experience this issue? I'm unable to reproduce it..

pybride commented 1 year ago

I retested with Serilog, and I still have the issue:

  1. Open a serilog log file
  2. Apply the windows layout with specific columns order => everything is fine
  3. Close the tab
  4. Reopen the log file => default columns are displayed, but additional window for docked views is still correctly displayed

As columns and docking are stored in the same file, if the docking is correctly loaded, it should be the same for columns, but it isn't the case. I checked the layout file, and the VisibleIndex is set in correct order, and missing for the unwanted columns.

LiorBanai commented 1 year ago

Ok, I want to see if I can fix it before releasing the next version

LiorBanai commented 1 year ago

@pybride what do you mean by: "but additional window for docked views is still correctly displayed" and "if the docking is correctly loaded, it should be the same for columns, but it isn't the case."

the docking wording is not clear to me..

pybride commented 1 year ago

by docking, I mean a secondary window with logger tree and detail view docked in it. When the corresponding layout is used, this secondary windows is correctly displayed and positioned, regardless of it is just after start, after opening a file or after re-applying the layout.

For the columns, only re-applying the layout will (re)load them correctly, otherwise is always the default ones.