Read a project store whole, and project it into a main page - #48
Merged
Merged
Conversation
A `.prj` is a marker file; everything about the project lives in the sibling `resources/project/` store, read entirely by convention. Five things that store says were being read wrongly or not at all, each of which made the viewer state something false about a real project: - A File entity's `location` is relative to its PARENT entity, not to the project root. Read verbatim, every file inside a folder reported a bare basename, so `utils/helper.m` and a root-level `helper.m` produced the same row. 357 of monophonic_syntethizer's 372 members are nested. - A path folder, a working folder and a project->project reference are all spelled `type="Reference"`; only the collection they sit in separates them. A scan across every collection therefore INVENTED references — that project has none and was reported as referencing three. The collections whose meaning we model are now skipped by name, rather than allow-listing the ones that hold references, because that collection's spelling varies by release and a missed spelling would drop real references. - The project root is on the MATLAB path, recorded as `Ref=""`, and is normally the first folder MATLAB adds. Testing the Ref for truthiness dropped it from almost every project. - Two collections of one type can coexist: a real project carries both `location="Root" type="Files"` (its members) and `location="ALM" type="Files"` (artifact tracking). Matching on type alone assigned the member list twice and let store order pick the winner — and the ALM collection holds no member files at all, only a DIR_SIGNIFIER, so losing that race meant zero members. - The `distributed` layout was not read at all. It carries no pointer documents: an entity's location and type are its filename. Both layouts now normalize to one entity shape, so every collection reader is layout-blind. A layout we cannot walk is reported instead of guessed at, since the readers would otherwise return a project that looks complete and empty. Then the parts of a project that were never modelled, which are most of what a project IS: entry points (shortcuts and the startup/shutdown files, including the run order the store encodes as a `*Prev` linked list and nothing else recovers), shortcut groups, the designated cache/codegen/startup locations, whether a label is MATLAB's or the project's own, and the declared metadata format. `buildProjectPage` projects all of it into the view model behind a project's main page. A project is not a table: MATLAB opens no document tab for one, and the file tree a table would show is already in the Explorer. What is nowhere else is everything around the file list, so that is what a page shows. The grouping, the run-order split, the label usage counts and the coverage figure are facts about the store rather than presentation, so they are derived once here and testable without a webview. Verified against two real stores: monophonic_syntethizer (fixedPathV2, 1166 metadata documents) and soc_swhw (distributed), both now reading with no warnings.
A reference resolved to { id, name } — a UUID and a basename — which is
enough to label a row and not enough to open anything. The store's own
`Ref` is a path relative to this project's root (`../Lib/Lib.prj`), and
it was read, used to derive the basename, and then dropped.
That left the page's References section with nowhere to point: its
`path` field held the UUID, so a host offering a link would have offered
to open a path that cannot exist. Reference is now { id, name, path },
and a reference the store gave no path for reports '' so the page can
tell that it has nothing to link.
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
.prjis a marker file; everything about the project lives in the siblingresources/project/store, read entirely by convention. This fixes five things that store says which were being read wrongly or not at all, adds the parts of a project that were never modelled, and projects all of it into the view model behind a project main page (rather than a table).The five defects
Each made the viewer state something false about a real project.
Fileentity'slocationis relative to its parent entity, not to the project root. Read verbatim, every file inside a folder reported a bare basename —utils/helper.mand a root-levelhelper.mproduced the same row. 357 of monophonic_syntethizer's 372 members are nested.type="Reference"; only the collection they sit in separates them. A scan across every collection therefore invented references: monophonic_syntethizer has none and was reported as referencing three.Ref="", and is normally the first folder MATLAB adds. Testing the Ref for truthiness dropped it from almost every project.location="Root" type="Files"(its members) andlocation="ALM" type="Files"(artifact tracking). Matching on type alone assigned the member list twice and let store order pick the winner — and the ALM collection holds no member files at all, only aDIR_SIGNIFIER, so losing that race meant zero members.distributedlayoutOn the reference fix, the collections whose meaning we model are skipped by name, rather than allow-listing the ones that hold references: that collection's spelling varies by release, and a missed spelling would silently drop real references, which is worse than the bug being fixed.
On
distributed, both layouts now normalize to oneEntityshape so every collection reader is layout-blind. A layout we cannot walk is reported through the warnings channel rather than guessed at — the readers would otherwise return a project that looks complete and is empty, the one outcome a user cannot tell apart from a fact about their project.What was never modelled
Most of what a project actually is: entry points (shortcuts and the startup/shutdown files, including the run order the store encodes as a
*Prevlinked list and nothing else recovers), shortcut groups, the designated cache/codegen/startup locations, whether a label is MATLAB's or the project's own, and the declared metadata format.The page
buildProjectPageprojects all of it into a view model. A project is not a table: MATLAB opens no document tab for one, and the file tree a table would show is already in VS Code's Explorer. What is nowhere else is everything around the file list, so that is what a page shows. The grouping, the run-order split, the label usage counts and the coverage figure are facts about the store rather than presentation, so they are derived once here and are testable without a webview.It lives beside the parser rather than in
datamodel/display/becausemoduleBoundaries.test.tspins that folder to zero outbound edges, and a projection ofParsedProjectneeds its types.Verification
Against two real stores, both now reading with no warnings:
fixedPathV2, 1166 metadata docsdistributed, 29 docsThose figures match the reviewed page mockup exactly. 4981 tests pass;
npm run verifyis clean.