Open
Conversation
Collaborator
📊 Performance Test ResultsComparing 93c1089 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
Contributor
fredrikekelund
left a comment
There was a problem hiding this comment.
I think we should consider excluding expired preview sites without an associated local sites. They are basically guaranteed to be deleted on the server, and they risk cluttering the output of this command.
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.
Related issues
How AI was used in this PR
Claude Code (Sonnet 4.5) helped scaffold the implementation and tests based on the existing
studio preview listcommand structure. I reviewed each change, iterated on several design decisions (flag vs. subcommand, grouping strategy, sort order, orphan coalescing), and ran the full lint/typecheck/test loop after each revision.Proposed Changes
--allflag tostudio preview listthat lists preview sites across all local Studio sites, grouped by siteUnknown sitegroupbuildSnapshotTable()helper so the single-site and--alltable rendering stay consistent--allpath (happy path, grouped headers, sort order, orphan fallback, orphan coalescing, expired badge, empty state) + 1 regression test for the single-site pathNote: The JSON output path (
--format=json) is unchanged by this PR — it already dumps the fullconfig.snapshotsarray regardless of the current site, so--allhas no effect there. Keeping that behavior consistent with the existing command; happy to tighten it up in a follow-up if desired.Testing Instructions
Setup: Have at least 2 local Studio sites with one or more preview sites each (use
studio preview createin each site folder to generate some).Happy path
npm run cli:buildnode apps/cli/dist/cli/main.mjs preview list --allMy Site (3 preview sites)Regression — existing single-site behavior
cdinto a Studio site foldernode apps/cli/dist/cli/main.mjs preview listEdge cases
preview list --allwith a user that has zero preview sites → friendlyNo preview sites foundmessage--all: runpreview listfrom~/Desktopor similar → clear error that the directory isn't added to Studio (unchanged behavior)Found N preview sites (M expired)in the--alloutputstudio auth logoutthenpreview list --all→Authentication requirederror (unchanged behavior)Automated
npm test -- apps/cli/commands/preview/tests/list.test.ts— 11 tests should passnpx eslint apps/cli/commands/preview/list.ts apps/cli/commands/preview/tests/list.test.ts— cleanPre-merge Checklist