Open new project's draft view from the new-project modal - #150
Merged
Conversation
Creating a project from the new-project modal discarded the returned project id and only reloaded the sidebar, leaving whatever thread was on screen visible. The per-project + button already landed on a draft via newThread(pid); reuse that path from the modal's Create handler so creating a project opens its draft view (model resolves in the background, Send disabled until then — LT6–LT9 semantics). Add an e2e test that drives the real modal flow and asserts the draft lands for the new project.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughProject creation now navigates directly to the new project’s draft view after reloading the project list. A Playwright test covers modal creation, folder selection, draft state, messaging, and cleanup. ChangesNew project flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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.
Problem
Creating a project from the new-project modal (the sidebar
+under "Projects") discarded the returned projectidand only reloaded the sidebar, leaving whatever thread was previously on screen visible. The per-project+button already landed on a draft vianewThread(pid); the modal did not.Change
crates/giskard-server/static/app.js— the$("pmCreate").onclickhandler now captures the created project'sidand callsnewThread(id)afterloadProjects(), reusing the exact same path as the per-project+button:newThreadrunsopenDraftThread(pid)(draws the draft synchronously, resets the composer, highlights the project row) thenapplyProjectDefaultModel(pid, state.draftThread)(resolves the default model in the background). All existing LT6–LT9 draft semantics therefore apply automatically — the draft opens before the project fetch, the model startsnullwithmodelLoadingshown, Send is disabled until the default resolves, and a late default won't clobber a user-picked model. No new draft logic was needed.Frontend-only behavioral change to an existing UI flow; no HTTP/WS route, config key, persisted shape, or appearance changed, so no README/spec/api-endpoints/screenshot updates are required.
Test
Added
tests/e2e/tests/new-project.spec.ts, which drives the real modal end-to-end againstgiskard-server-replay: opens#newProj, browses the picker to/tmp, names the project, clicks Create, and asserts the draft view lands for the new project (modal closes, project row highlighted.activewitharia-current="true", no thread active, composer visible and focused, transcript shows the draft explainer, model resolves to "Replay Model", Send enabled). It then sends a message to prove the draft is live, asserts the highlight correctly moves to the new thread row, and cleans up the project in afinally.This is the first e2e coverage of the new-project modal UI; existing specs created projects server-side via the API, so a regression dropping the
newThread(id)call would previously have gone undetected.Verification
Summary by CodeRabbit
New Features
Tests