-
Notifications
You must be signed in to change notification settings - Fork 1
refactor(browsers): reuse browser lookup logic #45
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
Conversation
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
Mesa DescriptionThis PR refactors the browser management commands to improve code reusability and enhance pagination. It centralizes browser lookup logic into a new Description generated by Mesa. Update settings |
Sayan-
left a comment
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.
overall lgtm! have some sequencing q's I'll ping you about internally!
| if page == nil || page.Items == nil || len(page.Items) == 0 { | ||
| pterm.Error.Println("No browsers found") | ||
| if browser == nil { | ||
| pterm.Error.Printf("Browser '%s' not found\n", in.Identifier) |
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.
Bug: View function lost persistence ID lookup compatibility
The View function previously supported looking up browsers by either session ID or persistence ID (by iterating through list results). The refactored code now calls b.browsers.Get() directly with the identifier, which likely only accepts session IDs. This breaks backward compatibility for users who pass a persistent ID to kernel browsers view <persistence-id>. The Delete function correctly uses resolveBrowserByIdentifier which explicitly supports both identifier types for backward compatibility, but View and the new Get function bypass this helper.
Note
Adds a
browsers getcommand for detailed session info and switchesview/deleteto use direct Get-based lookups with pagination helpers.browsers get <id>to display detailed browser session info (table or--output json).Getand prints live view URL to stdout; warns when headless or URL missing.getcommand and--outputflag.BrowsersServicewithGet.buildBrowserTableDatafor shared table rendering.resolveBrowserByIdentifier; add full pagination vialistAllBrowsersandsafeGetNextPage.get,view(headless/missing/err), and error paths.Getand new behaviors.Written by Cursor Bugbot for commit be7d1c5. This will update automatically on new commits. Configure here.