Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framable (iframe); rebust responsiveness and refactored mobile view #325

Merged
merged 18 commits into from
May 31, 2024

Conversation

mondoreale
Copy link
Contributor

Few things happened here:

  1. The explorer can now be put inside an iframe and it'll behave as instructed (there are options).
  2. The sidebar got redone so that it's responsive and doesn't break the layout even when the space is tight.
  3. Explorer when loaded via iframe does not pollute host's history (odd thing in general) – lmk if you wanna know more.
  4. Controls (incl. network selector) are now combined as a single layer, and respect each other's presence.

This and many many more improvements.

HUD options one can use to embed a perfect Explorer onto their site:

const Hud = {
  /**
   * Set `ConnectionMode.Always` on load.
   */
  showConnections: /*         */ 0x0001,
  /**
   * Show the connection mode toggle.
   */
  showConnectionsToggle: /*   */ 0x0002,
  /**
   * Show the node list for the current context (stream or selected node).
   */
  showNodeList: /*            */ 0x0004,
  /**
   * Show the network selector dropdown.
   */
  showNetworkSelector: /*     */ 0x0008,
  /**
   * Show the viewport reset button.
   */
  showResetViewportButton: /* */ 0x0010,
  /**
   * Show the search.
   */
  showSearch: /*              */ 0x0020,
  /**
   * Use tighter padding around the search and the controls.
   */
  compact: /*                 */ 0x0040,
  /**
   * Show zoom in and out buttons.
   */
  showZoomButtons: /*         */ 0x0080,
  /**
   * Fly to node on select.
   */
  autoCenter: /*              */ 0x0100,
} as const

Sum of desired options has to be passed via the ?hud= GET param.

For example, to open the explorer with

  • on-select auto-center,
  • compact padding, and
  • just the zoom buttons, visit

http://localhost:3000/?hud=448

Devs can experiment with each of these in the Storybook (npm run storybook).

mondoreale added 18 commits May 27, 2024 15:22
This will need love, i.e. the responsiveness. It's gonna be better tho.

We're prepping to support query string display params.
Now it doesn't stand out and confuse the user that it's 0 results for nodes.
Nothing worse than not knowing wtf is going on, smh!

Expect breaking changes here.
This improves overall UX for the sidebar on both small and large screens.
- Active view changes to "Map" more reliably and at an accurate moment.
- On mobile clicking items in the search result actually take the user to the clicked item. Previously it'd contract the list and do nothing more.
- Sidebar is more CSS-driven rather than JS-driven altho js is still there (gotta be). Certain in-JS calculations are gone for good tho.
Had to be restructured completely for reasonable outcome. Looks like I nailed it! Vertically and horizontally responsive. Cheers!
@mondoreale mondoreale merged commit e198b45 into master May 31, 2024
3 checks passed
@mondoreale mondoreale deleted the framable branch May 31, 2024 17:04
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.

1 participant