Refactor Shell Page to Components and Hooks#1868
Conversation
This change refactors `tavern/internal/www/src/pages/shellv2/index.tsx` by splitting it into logical components and extracting business logic into a custom hook. Changes: - Extracted shared types to `types.ts` and GraphQL queries to `graphql.ts`. - Created `useShell` hook in `hooks/useShell.ts` to manage state, data fetching, and terminal logic. - Created `ShellTerminal`, `ShellStatusBar`, and `ShellCompletions` components in `components/`. - Updated `index.tsx` to be a lightweight wrapper composing these elements. This improves maintainability and separation of concerns. Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Summary
Previous Results
Insights
Fail Rate
Failed Tests
Slowest Tests
🍂 No flaky tests in this run. Github Test Reporter by CTRF 💚 🔄 This comment has been updated |
1. Fixes CI failure in `implants` job by removing invalid `default` and `profile` inputs from `dtolnay/rust-toolchain`. 2. Refactors `tavern/internal/www/src/pages/shellv2/index.tsx` into components and hooks for better maintainability. - Extracted shared types to `types.ts` and GraphQL queries to `graphql.ts`. - Created `useShell` hook in `hooks/useShell.ts` to manage state, data fetching, and terminal logic. - Created `ShellTerminal`, `ShellStatusBar`, and `ShellCompletions` components in `components/`. - Updated `index.tsx` to be a lightweight wrapper composing these elements. Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
This change updates the CI workflows (`.github/workflows/*.yml`) to build the frontend assets (`tavern/internal/www/build`) before building the Tavern backend. This is necessary because the backend embeds these assets using `go:embed`, and the build artifacts are no longer checked into the repository. Additionally, this change fixes the `dtolnay/rust-toolchain` configuration in the workflows by removing the invalid `default` and `profile` inputs. Changes: - Updated `.github/workflows/e2e-asset-execution.yml` - Updated `.github/workflows/e2e-portals.yml` - Updated `.github/workflows/e2e-repl-test.yml` - Updated `.github/workflows/tests.yml` - All workflows now include a `Build Frontend` step (npm ci & npm run build). - Rust toolchain setup is cleaned up. Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
This change updates the CI workflows (`.github/workflows/*.yml`) to build the frontend assets (`tavern/internal/www/build`) before building the Tavern backend. This is necessary because the backend embeds these assets using `go:embed`, and the build artifacts are no longer checked into the repository. Additionally, this change fixes the `dtolnay/rust-toolchain` configuration in the workflows by removing the invalid `default` and `profile` inputs. Changes: - Updated `.github/workflows/e2e-asset-execution.yml` - Updated `.github/workflows/e2e-portals.yml` - Updated `.github/workflows/e2e-repl-test.yml` - Updated `.github/workflows/tests.yml` - All workflows now include a `Build Frontend` step (npm ci & npm run build). - Rust toolchain setup is cleaned up. Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
This change addresses multiple CI failures:
1. **Frontend Build**: Added `npm ci` and `npm run build` steps to `.github/workflows/*.yml` (e2e tests and unit tests). This is required because `tavern/internal/www/build` (assets) is no longer checked into the repo, but `go build` depends on it via `//go:embed`.
2. **Lint Errors**: Fixed ESLint errors in `tavern/internal/www/src` that were causing the frontend build to fail in CI (where warnings are treated as errors).
- Fixed redundant `role="list"` on `ol` in `FormSteps.tsx`.
- Fixed missing dependency `toast` in `useEffect` in `Shell.tsx`.
- Fixed unexpected comma operator usage in `utils.ts`.
- Fixed unused `Button` import in `ShellStatusBar.tsx`.
3. **Rust Toolchain**: Removed invalid `default` and `profile` inputs from `dtolnay/rust-toolchain` configuration in workflows to silence warnings and prevent potential future errors.
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
This change addresses multiple CI failures:
1. **Frontend Build**: Added `npm ci` and `npm run build` steps to `.github/workflows/*.yml` (e2e tests and unit tests). This is required because `tavern/internal/www/build` (assets) is no longer checked into the repo, but `go build` depends on it via `//go:embed`.
2. **Lint Errors**: Fixed ESLint errors in `tavern/internal/www/src` that were causing the frontend build to fail in CI (where warnings are treated as errors).
- Fixed redundant `role="list"` on `ol` in `FormSteps.tsx`.
- Fixed missing dependency `toast` in `useEffect` in `Shell.tsx`.
- Fixed unexpected comma operator usage in `utils.ts`.
- Fixed unused `Button` import in `ShellStatusBar.tsx`.
3. **Rust Toolchain**: Removed invalid `default` and `profile` inputs from `dtolnay/rust-toolchain` configuration in workflows to silence warnings and prevent potential future errors.
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
Refactor
tavern/internal/www/src/pages/shellv2/index.tsx, splitting it into logical components. Store these components intavern/internal/www/src/pages/shellv2/components.index.tsxshould only be a small wrapper that composes the top level components for the page. Be sure to separate style from function, moving functionality to utility functions. Please reference our other pages for style inspiration.PR created automatically by Jules for task 6494286688351882391 started by @KCarretto