Skip to content

Conversation

@miloush
Copy link
Contributor

@miloush miloush commented Oct 11, 2025

Implements #3582 to show history items:

image

@aybe

@siegfriedpammer
Copy link
Member

Why do we need a NavigationText property?

@miloush
Copy link
Contributor Author

miloush commented Oct 11, 2025

Because it differs from what is in the tree, it shows full types, members including type, and assembly name for some of the folders (screenshot first item)

@miloush
Copy link
Contributor Author

miloush commented Oct 11, 2025

I can also imagine it could be a method where you put current state and the text would differ on where you are (like same namespace or same assembly)

@siegfriedpammer
Copy link
Member

siegfriedpammer commented Oct 11, 2025

I think I am fine with that. Does need to be in the SharpTreeNode base class? Also definitely needs a separator other than space...

@siegfriedpammer
Copy link
Member

It's also important to use the settings-aware implementation for the node text that is used everywhere else.

@miloush
Copy link
Contributor Author

miloush commented Oct 11, 2025

It has a default implementation returning Text so no extra work for inheritors if the entry is to be the same as in the tree. NavigationState is holding SharpTreeNode nodes so that's why I put it there.

You can see in the changed files that it follows what Text is doing. The only "new syntax" is the space for the folders. What would you prefer? >?

With that said, I don't mind using Text directly if that was preferred. I just didn't find it too helpful for navigation.

@siegfriedpammer
Copy link
Member

Maybe put the folder in parentheses?

I am not sure. I can have a closer look when I get home. Reviewing code on the phone is not ideal. 😅

@miloush
Copy link
Contributor Author

miloush commented Oct 11, 2025

I put the folder first and where it belongs in parentheses, looks better, see the updated screenshot.

@miloush
Copy link
Contributor Author

miloush commented Oct 11, 2025

I also tried to include module name in the metadata nodes but feel free to skip that commit. Done working on this PR until there is feedback to address.

@siegfriedpammer
Copy link
Member

One thought I had: is it possible to get an actual dropdown toolbar button in WPF? Is this only included in some community library?

@miloush
Copy link
Contributor Author

miloush commented Oct 11, 2025

There is no built-in dropdown button in WPF. I considered creating a control for it (or retemplating combobox) but since the theme and styles are external it didn't seem worth it. We could also just have it as context menu on the normal buttons and that's it.

: metadata.GetString(metadata.GetModuleDefinition().Name);
if (metadata.IsAssembly)
value = metadata.GetString(metadata.GetAssemblyDefinition().Name);
else if (metadata.DebugMetadataHeader == null) // standalone debug metadata does not contain module table
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should check Kind instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GetModuleDefinition throws on non-null DebugMetadataHeader, so that felt like an appropriate check before invoking it.

I don't mind changing it to Kind check, but I would need some hint about which Kinds guarantee DebugMetadataHeader, as I don't know how to produce e.g. WebCIL to check.

@siegfriedpammer
Copy link
Member

I am playing around with your PR and something I noticed:

grafik

this doesn't seem to be very useful... I think each item should include the top-level ancestor, maybe?

@miloush
Copy link
Contributor Author

miloush commented Dec 3, 2025

Yeah I am aware of that. I thought it is a rare if not adverse scenario where you would jump through the same nodes in different assemblies. I thought about adding the top-level info, but then all the items become cluttered with full assembly name for minimal benefit in rare cases. Next thing you come with will be same assembly names using different file locations, so I think the line needs to be drawn somewhere.
(to be fair I only considered adding assembly name rather than top node text, and some of the nodes, especially in the metadata bits, do not have assembly/module associated, so it didn't really help)

This is not intended to replace user's memory. You still know what you have been doing recently so you will have an idea where the items come from.

With that said, with the NavigationText we can fine tune this easily on per node basis. For example, for namespaces we could include assembly name.

I could also do some analysis when building the history list, and if the previous item "looks the same" but has different top level, append the top level.

@siegfriedpammer
Copy link
Member

You are right. It's probably fine the way it's now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants