Repository navigation
New project modes, canvas content on disk, and canvas tab actions #170
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
Changes from 19 commits
d63d7c7
8a104c7
e8eab95
e6badd7
5d41085
7d482f9
2e11b02
4f3a562
b254750
e095463
b66bd4d
4a58550
7170b56
25781cc
f79fb33
ac89c74
cb62355
70c54bf
9197aa9
31dd9b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -300,11 +300,19 @@ export function boardIndex( | |
| thumbs: [] as string[], | ||
| assets: assetIndex(folder), | ||
| comments: readJson(path.join(folder, "comments.json")), | ||
| // null for a canvas.json that is there but unreadable, a merge left half done say: | ||
| // the page must not take it for none and write over it (canvasContent.ts). | ||
| content: fs.existsSync(path.join(folder, "canvas.json")) | ||
| ? (readJson(path.join(folder, "canvas.json")) ?? null) | ||
| : undefined, | ||
| docs: readDocs(folder), | ||
| }; | ||
| }) | ||
| .filter( | ||
| (b): b is NonNullable<typeof b> => b !== null && b.html.length > 0, | ||
| // A folder with no board yet is a canvas once it has a layout.json, which is what the | ||
| // canvas strip's "+" makes (sp.ts, /__sp/new-canvas). | ||
| (b): b is NonNullable<typeof b> => | ||
| b !== null && (b.html.length > 0 || b.layout !== undefined), | ||
|
Comment on lines
312
to
+316
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For a project canvas whose slug matches a shipped example, admitting a layout-only folder here is inconsistent with Useful? React with 👍 / 👎.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed: folderOf now counts a folder with a layout.json as the project's own, matching the index, so a layout-only canvas under an example's name is writable. Covered in sp.test.ts. |
||
| ); | ||
| return { | ||
| served: options.served, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a person pastes, moves, or deletes content on an existing canvas, this new persistence path changes
canvas.json(and sometimesfiles/) butboardIndex.updatedstill considers only HTML mtimes, while/__sp/projects.jsonderives the project's timestamp from that value, root-directory mtime, and documents. Consequently Home's “Edited” label and last-edited ordering never reflect these user edits; include the persisted canvas files in the canvas/project timestamp.Useful? React with 👍 / 👎.