question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Simplify Webview Architecture

See original GitHub issue

After the new designs, all that remains in the table Webview is displaying the Experiments as a table:

New table design

This, along with a shift toward native UI elements like TreeViews, means we need to move a lot of the webview logic into the extension and, ideally, not duplicate work within the Webview. Since the webview handles a lot right now, it’s best to break this into steps

Tasks

From a high level, one can consider refactoring out the columns a task that can be handled separately from moving over the experiments themselves. From there, both tasks can be broken up into a sequence of smaller tasks.

Columns can be fully reimplemented can before starting on experiments, and doing to will allow us to work on both refactoring the Webview and building on the Columns data in parallel.

  • Columns

    • Parse and expose the column schema in Extension (#358)
    • DRY-ly use the extension-parsed columns in the Webview table
    • Add native UI elements for column control (#359 #362 #363), which can be usable pre-experiments by puppeting react-table’s filter/sort/hide state
    • Remove Webview columns UI
  • Experiments

    • Parse experiments (turn the object into an array, organize baselines and checkpoint_tips into the hierarchy they represent) in the extension
    • Sort experiments in the extension
    • Filter experiments in the extension
    • Remove sort/filter logic from Webview and consume from Extension
    • Make a native UI to keep track of experiments at a glance

Other considerations:

  • We could explore using command URI links instead of JS-based message passing
  • With so much less responsibility, we can use a much lighter and simpler state solution for the webview, like useReducer

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
rogermparentcommented, May 8, 2021
  1. Was talking with a friend last night about having to move all of the data to the extension and could not articulate exactly why the data couldn’t live in the React model along with sorting and filtering options. what I am talking about is a single copy of the data in the Webview along with extra information about sorting and filtering. I think there is going to have to be two way communication about hiding / sorting columns anyway but like I said, I must be missing something.

I don’t blame you for considering this, my reasoning for moving most of the state into the Webview would be that the new design moves most of the sort/filtering UI into native UI widgets like Treeviews and Quickpicks, so the Experiments UI as a whole is going to become just as involved with the Extension side as it is the Webview side, if not more so.

I believe it makes more sense to change the Webview to consume a new Extension-side Experiments data source than it would be to make all the new native UI bits have to work with data message-passed from the Webview.

1reaction
mattseddoncommented, May 7, 2021

I must be missing something, I’ll go back and look at the design again on Monday.

The reason that I was asking was:

  1. Breaking up the work into smaller chunks always helps with velocity.
  2. Feels like we were getting close to a POC that we could actually do a beta release with and dismantling what we have instead of incrementally moving to the correct design derails that.
  3. Was talking with a friend last night about having to move all of the data to the extension and could not articulate exactly why the data couldn’t live in the React model along with sorting and filtering options.

For 3 what I am talking about is a single copy of the data in the webview along with extra information about sorting and filtering. I think there is going to have to be two way communication about hiding / sorting columns anyway but like I said, I must be missing something.

Have a good weekend, see you in the future 👍🏻 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding WebViews - KIRUPA
A WebView is just the browser engine part that you can insert sort of like an iframe into your native app and programmatically...
Read more >
Simplifying VS Code Webview Development with vscode-page
With Webview, you can build a complex UI for users of your extension. And its development is not a hard work: Design html...
Read more >
WebView for AOSP system integrators
Overview. This guide is intended for anyone building and distributing AOSP (e.g. Android device manufacturers or maintainers of custom ROM images) who ...
Read more >
WebView stub apk to simplify installation · Issue #520 - GitHub
This file could be installed to the system or a magisk module folder to obtain the proper privileges and be registered in the...
Read more >
Ionic Portals Aims to Simplify the Integration of Web Apps into ...
Ionic Portals is based on Capacitor, a native runtime that enables the creation of hybrid native apps using JavaScript, HTML, and CSS. According ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found