Skip to content

Improve look and feel of graph info html output - #20548

Open
perseoGI wants to merge 2 commits into
conan-io:develop2from
perseoGI:pgi/feature/graph-info-html-ui
Open

perseoGI wants to merge 2 commits into
conan-io:develop2from
perseoGI:pgi/feature/graph-info-html-ui

Conversation

@perseoGI

Copy link
Copy Markdown
Contributor

Changelog: Feature: Improve the look and feel of the conan graph info --format=html output.
Docs: Omit

Refresh of the html graph page, it looked quite dated. No new external dependencies, still vis-network only.

  • New header with the Conan logo and a legend rendered in html (previously it was a tiny vis canvas, hard to read).
  • Updated binary status colors, closer to the previous ones but less saturated.
  • Sidebar restyled: switches instead of checkboxes, cleaner inputs.
  • Node/edge information is now shown as a key/value list with collapsible sections (settings, options, cpp_info, dependencies...) instead of a raw JSON dump. Dependencies are shown by their ref instead of node id.
  • "Raw JSON" toggle and "Copy" button in the information panel.
  • Graph errors are shown in a collapsible box at the top of the sidebar.
  • "Fit to screen" button.

Example graph with all the binary status types (same graph, libcurl selected):

Before

before

After

after

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

@davidsanfal davidsanfal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few non-blocking comments.

display: grid;
grid-template-columns: 75% 25%;
grid-template-rows: 50px auto;
grid-template-columns: minmax(0, 1fr) 340px;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggest extracting the sidebar width into a variable so #fit doesn't depend on a hardcoded value:

Suggested change
grid-template-columns: minmax(0, 1fr) 340px;
--sidebar-width: 340px;
grid-template-columns: minmax(0, 1fr) var(--sidebar-width);

.chip { padding: 1px 8px; border: 1.5px solid #64748b; border-radius: 4px; background: white;
font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; }
.legend-sep { width: 1px; height: 18px; margin: 0 6px; background: #dbe1e8; }
#fit { position: fixed; right: 356px; bottom: 16px; padding: 6px 12px; font-size: 13px; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

right: 356px is coupled to the sidebar width (340px + 16px). If the width changes, the button gets misplaced. With the variable above:

Suggested change
#fit { position: fixed; right: 356px; bottom: 16px; padding: 6px 12px; font-size: 13px; }
#fit { position: fixed; right: calc(var(--sidebar-width) + 16px); bottom: 16px; padding: 6px 12px; font-size: 13px; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Leftover from the old palette:

Suggested change
highlight: {background: "black", border: "#6366f1"}},

Comment on lines 406 to 409
copy.onclick = () => navigator.clipboard.writeText(raw.textContent).then(() => {
copy.textContent = "Copied!";
setTimeout(() => copy.textContent = "Copy", 1500);
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

navigator.clipboard.writeText can reject (non-secure context, permission denied), and right now it fails silently. Suggest adding a .catch():

Suggested change
copy.onclick = () => navigator.clipboard.writeText(raw.textContent).then(() => {
copy.textContent = "Copied!";
setTimeout(() => copy.textContent = "Copy", 1500);
});
copy.onclick = () => navigator.clipboard.writeText(raw.textContent).then(
() => copy.textContent = "Copied!",
() => copy.textContent = "Copy failed"
).finally(() => setTimeout(() => copy.textContent = "Copy", 1500));

@franramirez688 franramirez688 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking great @perseoGI ! I like a lot the new style 👏

Just one comment before moving forward. I just tried one example with conflicts, and I'm not sure about the information that it's shown on the top of the screen:

Screenshot 2026-11-26 at 12 21 48

Even expanding all the information, I do not think that it's useful. Let's review that flow.

UPDATE: the scroll button levelSeparation when expanding the Extra graph controls is not working as expected, but it's not because of your changes. If you can have a look too... 🙏

- Readable error messages with a button to locate the node in the graph
- Fix levelSeparation slider with DU direction
- Fit vis configuration panel in the sidebar
- Handle clipboard errors, use a variable for the sidebar width
@perseoGI

Copy link
Copy Markdown
Contributor Author

Thank you for your review @davidsanfal @franramirez688
I tried to provide a minimal git diff in the first place in order to allow easy review.
I've adapted the code, increasing a little bit the diff but addressing your comments.
I'm attaching a graph info example with a full case set of different packages and a conflict.

graph-info-example.html

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants