Repository navigation
Sheets: a whole page pushed again with the same data draws the sheet again - #8
Merged
Merged
Conversation
…again The platform's morph lays a pushed page's source over what the page's script drew wherever it can't tell them apart: the status line and the cell's address always, and with no earlier page to compare against, the grid, the tabs and the charts too. A page whose data block changed was read again and drawn; one whose data was the same (a save straight after a push of the same page, which happens whenever data.json keeps its saved_at, or a new description only) was left as the morph made it: "Loading…" in the status line, "A1" as the address, and in the worst case an empty grid. The "ss:live" listener now draws again, where the person is, after any whole page with the same data, and still applies a batch once. Co-authored-by: Pointman <noreply@pointman.ai> Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Pointman <noreply@pointman.ai> Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A whole page pushed again with the same data now makes the sheet draw itself again. Before this, the status line, the cell's address and sometimes the whole grid were left as the platform's morph had reset them.
What went wrong
A live push whose scripts haven't changed is morphed in place, and no script runs again. Wherever the morph can't tell the pushed page's source apart from what the page's script drew, it puts the source back:
Loading…Summary!B3)A1, while the bar still shows B3's formulaThe
ss:livelistener only redrew when#sheet-data's text had changed, or when a batch arrived. A whole page with the same data was left as the morph made it.A real build reaches this.
sheet-format.mdasks the agent to writesaved_at. When data.json keeps it and the last push beforesavewas a whole page,savepushes a page identical to the one already on screen. One example is a 14 Nov bench run: data.json last changed at 65.8 s, then the page was pushed at 69.7 s and the save pushed it again at 77.0 s. A tab watching that run ends showing "Loading…". A push that changes only the description has the same effect.The change
sheet-template.html: after any whole page (ss:livenamessheet-data) whose data is the same, the listener callsredraw(). That function runsrender()andselect(), then puts the person's place back, asretake()does. A batch is still applied once and drawn once. A whole page that empties a batch block redraws without applying the batch a second time.Tested
node tests/run.js: 82/82 (Node 22). There is one new test, "after a whole page with the same data, the page draws again where the person is". It runs the page's ownss:livelistener with the blocks as each kind of update leaves them: a morph or stream with the same data, one that empties a batch, new data, a batch, a diff that names neither block. On the previous template, this test and the updated regex fail (80/82).npx spacesheep skills lint: well-formed, hash 4d046be9c48c.packages/content/src/index.ts(morphNode, morphChildren, putBack, morphPage as written there), on a built two-tab sheet with a chart. Each case is a freshly loaded tab, signed in, with a cell selected:Worth a close look
wholeassumes only a whole-page morph or stream namessheet-datawith unchanged text. A diff names only blocks it changed, and a patch that changessheet-datachanges its text (and goes toretake()).redraw()reuseskeptfor the place, asretake()does. The morph's own scroll events arrive a frame later, so they don't overwrite it first.