Repository navigation
Project: a built-in plugin that shows the spec folder's code repository on its own tab - #548
Merged
Merged
Conversation
…ry on its own tab Switched on, a specifications folder gets a Project tab beside Specs with the files of its default code repo (Project settings): the tree, the code editor with autosave and the "changed on disk" notice, Open in IntelliJ, Git Pull, the name search and the text search. Everything on the tab is the Files tab of code repository mode, pointed at that repository. - src/plugins/builtin/project: the plugin. Its routes, /api/project/root and /api/project/files/*, exist only while it is on, and refuse in a hosted worker, the demo and the read-only site. Its urls are /project and /project/<path>. Off by default. - The tab is there only while the folder has a code repository on disk, and follows Project settings at once: a new client event, "project/changed", is emitted when that page saves. - src/server/filesRoutes.ts: the files handlers moved out of api.ts, so the core's /api/files/* and the plugin's routes are one implementation. - src/frontend/files: the sidebar, pane and search take the tab's urls and name; the stores read from whichever set of routes the mounted tab names (files/api.ts). A code repository opened directly is unchanged. Not done: a file open on the Project tab is not attached to a coding agent message, since that attachment is resolved against the open specifications folder.
…-code-repo-efd9a4 # Conflicts: # src/server/api.ts
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.
What changes
A new built-in plugin, Project. Switched on, a specifications folder gets a Project tab beside Specs that shows the files of its default code repo (Project settings), the way a code repository opened directly shows them:
.gitand without what the repository ignoresIts urls are
/project(the repository's README.md) and/project/<path>;g freaches the tab.How it behaves
How it is built
src/plugins/builtin/project/— manifest, route, host half and browser half. The routes (/api/project/root,/api/project/files/*) exist only while the plugin is on, so a switched-off tab answers 404.src/server/filesRoutes.ts— the files handlers, moved out ofapi.tsunchanged. The core's/api/files/*and the plugin's routes are built from the same handlers, each with its own way of finding the folder.src/frontend/files/— the sidebar, pane and search results take the tab's urls and name as props; the stores read from whichever set of routes the mounted tab names (files/api.ts). The two tabs are never mounted together.src/plugins/client/tabs.ts,App.tsx— a new client event,project/changed, emitted when Project settings saves.Not done
A file open on the Project tab is not attached to a coding agent message the way the Files tab's open file is. That attachment is resolved against the open specifications folder, so a code-repository path would name the wrong file.
Checks
bun test: 4,172 pass, 0 fail. 19 of them are new (tests/projectPlugin.test.ts,tests/projectTab.test.tsx); three existing tests list the new plugin row.bun run typecheck: clean.idea, the tab going and returning as the code repo was removed and added in Project settings, and the tab and its routes going when the plugin was switched off.Spec
specs/app/project-plugin.feature.mdin the spec repository: six proposed scenarios, every new test linked. It is a separate repository and not part of this PR.