From 72dd989ad963612204fa92a484a56abfbed4df8a Mon Sep 17 00:00:00 2001 From: Jonathan Sick Date: Thu, 11 Apr 2024 10:44:33 -0400 Subject: [PATCH] Add changesets for squareone "Recompute" work --- .changeset/brown-dingos-mix.md | 7 +++++++ .changeset/chatty-bikes-unite.md | 5 +++++ .changeset/seven-maps-drum.md | 5 +++++ 3 files changed, 17 insertions(+) create mode 100644 .changeset/brown-dingos-mix.md create mode 100644 .changeset/chatty-bikes-unite.md create mode 100644 .changeset/seven-maps-drum.md diff --git a/.changeset/brown-dingos-mix.md b/.changeset/brown-dingos-mix.md new file mode 100644 index 00000000..14101684 --- /dev/null +++ b/.changeset/brown-dingos-mix.md @@ -0,0 +1,7 @@ +--- +'squareone': minor +--- + +Implement background recomputation for cached Times Square pages. The "Recompute" button submits a request to Times Square's `DELETE /v1/pages/:page/html?{params}` endpoint, which causes a background recomputation of the notebook and re-rendering of the cached HTML. + +The new `TimesSquareHtmlEventsProvider` is a React context provider that provides real-time updates from Times Square about the status of an HTML rendering for a given set of parameters using Times Square's `/v1/pages/:page/html/events/{params}` endpoint. Squareone uses `@microsoft/fetch-event-source` to subscribe to this server-sent events (SSE) endpoint. Using this provider, the UI is able to show new data to the user, including the status of the computation, and once the computation is complete, the date/age of computation and the execution time. diff --git a/.changeset/chatty-bikes-unite.md b/.changeset/chatty-bikes-unite.md new file mode 100644 index 00000000..070246d0 --- /dev/null +++ b/.changeset/chatty-bikes-unite.md @@ -0,0 +1,5 @@ +--- +'squareone': minor +--- + +The Times Square "Update" and "Reset" buttons are now disabled when appropriate. The Update button is disabled when the parameter inputs have not been changed relative to their current state. Likewise, the Reset button is disabled when the parameters are unchanged from the current state. diff --git a/.changeset/seven-maps-drum.md b/.changeset/seven-maps-drum.md new file mode 100644 index 00000000..3b0e3cbb --- /dev/null +++ b/.changeset/seven-maps-drum.md @@ -0,0 +1,5 @@ +--- +'squareone': minor +--- + +New `TimesSquareUrlParametersProvider` component. This React context provides the URL-based state to Times Square components, such as the page being viewed, its notebook parameters values, and the display settings. This change simplifies the structure of the React pages by refactoring all of the URL parsing into a common component. As well, this context eliminates "prop drilling" to provide this URL-based state to all components in the Times Square application.