Hey team,
In preparation for our design session meeting tomorrow, I want to explain a bit more about a vision of mine. I alluded to this vision during our last session so I want to flesh it out a bit.
To start: Ghislaine and I had a 1:1 today where we talked about some of this, and she mentioned another product which has a concept of a “worksheet”. I’ve been searching for a word like this! To me, “worksheet” perfectly captures what I’m after, so I’ll use that word in this email.
In my vision, users would do most of their work through worksheets. Worksheets would replace our table page, exploration pages, column display options, and table metadata — and would lay a powerful foundation for building more elaborate visualizations and interfaces.
Here’s how worksheets would work:
For the data model, each worksheet would have:
select * from authors;
.Navigation
Mathesar would have “New Worksheet Page” where users can build a worksheet from scratch. In some ways this would be similar to our current Data Explorer. However, the entire worksheet state would be serialized into the URL as the user modifies the worksheet definition.
Users would be able to save worksheets privately to their user account and also share them with other Mathesar users within their workspace. Saved worksheets would get a name, description, and a dedicated route.
Mathesar would still have a Schema Page which shows a list of tables. Instead of pointing to a “Table Page”, each table in the list would link to a “New Worksheet Page” with a query that selects all columns and a display of type “sheet”. This would feel a lot like our current Table Page but would be a lot more powerful.
Worksheets would be able to modify data in the following ways (ordered from least consequential to most):
Temporary data changes: Worksheets would have the ability to store and modify temporary data like the state of the user’s selection. This would only persist in the browser tab — nowhere else.
Worksheet definition changes: Worksheets could modify their own definitions. For example, on a “sheet” type worksheet, a user could interact with a “Filters” UI to apply a filter (much like on our Table Page). That action would alter the query definition within the worksheet, forcing Mathesar to re-serialize the entire worksheet definition and store it in URL — even for previously saved worksheets. This way if a worksheet has unsaved changes to its definition, the user could still (say) send the URL to a colleague or bookmark it. As another example, if a user resizes a column within a sheet, re-orders columns, or adjusts the formatting for a number, those changes would be persisted in the display settings of the worksheet.
DML changes: Worksheets would have the ability to modify cells, add records, and delete records. Mathesar would be smart enough to statically analyze the SQL and construct the appropriate mechanisms to update data in most cases. I see this as perhaps one of the most challenging aspects of my worksheets vision. “Connecting the dots” between a cell in the query output and a cell in the database is either tricky, really tricky, or impossible. But in the cases where it matters, I do think it’s possible. And if we can just get part of the way there we’d be able to offer something tremendously powerful. I would imagine building (or finding) a low-level library for this. That work is something I’d be very interested personally in doing!
DDL changes: Worksheets would also be able to modify the database schema. This would lead to some tricky UX questions like “do you want to rename the column in the underlying table or alias the column within the worksheet definition?” — but I think those questions are solvable. Also: some DDL changes wouldn’t fit well within the worksheet interface, so I would imagine Mathesar having a separate “Structure Editor” page that prioritizes DDL changes and alleviates some of the UX design pressure on the worksheet, especially at first.
The query editor
The “sheet” display type
Other cool things