Skip to content

Refactor Shell Page to Components and Hooks#1868

Closed
KCarretto wants to merge 12 commits intomainfrom
refactor-shell-page-6494286688351882391
Closed

Refactor Shell Page to Components and Hooks#1868
KCarretto wants to merge 12 commits intomainfrom
refactor-shell-page-6494286688351882391

Conversation

@KCarretto
Copy link
Collaborator

Refactor tavern/internal/www/src/pages/shellv2/index.tsx, splitting it into logical components. Store these components in tavern/internal/www/src/pages/shellv2/components. index.tsx should 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

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>
@google-labs-jules
Copy link
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2643    ±0 2642    ±0 1    ±0 0    ±0 0    ±0 0    ±0 1ms    ±0

Previous Results

Build 🏗️ Result 🧪 Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
#1135 2643 2642 1 0 0 0 492172h 50m

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2643 0 1 6.3s

Fail Rate

Fail Rate 0.04%    ±0
Test 📝 Results 📊 Passed ✅ Failed ❌ Fail Rate (%) 📈
TestPortalClose 1 0 1 100.00    ↑100.00

Failed Tests

Failed Tests
❌ TestPortalClose
=== RUN   TestPortalClose
2026/02/23 04:50:24 INFO Receive loop exited topic=PORTAL_IN_1
2026/02/23 04:50:24 INFO Receive loop exited topic=PORTAL_OUT_1
    portal_close_test.go:23: 
        	Error Trace:	/home/runner/work/realm/realm/tavern/internal/portals/portal_close_test.go:23
        	Error:      	Received unexpected error:
        	            	failed to create user: ent: constraint failed: UNIQUE constraint failed: users.oauth_id
        	Test:       	TestPortalClose
--- FAIL: TestPortalClose (0.07s)

Trace:

No trace available

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
TestDockerExecutor_Build_ContextCancellation 1 6.3s 6.3s
eldritch-libsys: std::dll_inject_impl::tests::test_dll_inject_simple 1 5.1s 5.1s
TestInteractiveShell 1 5.0s 5.0s
TestOtherStreamOutput 1 5.0s 5.0s
imix::bin/imix: install::tests::test_install_execution 3 1.5s 4.3s
imix::bin/imix: install::tests::test_install_execution 3 1.5s 4.3s
imix::bin/imix: install::tests::test_install_execution 3 1.5s 4.3s
TestDockerExecutor_Build_SimpleEcho 1 4.2s 4.2s
imix::bin/imix: tests::task_tests::test_task_streaming_output 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_streaming_output 3 3.0s 3.0s

🍂 No flaky tests in this run.

Github Test Reporter by CTRF 💚

🔄 This comment has been updated

google-labs-jules bot and others added 4 commits February 23, 2026 03:34
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>
@KCarretto KCarretto marked this pull request as ready for review February 23, 2026 03:51
@KCarretto KCarretto enabled auto-merge February 23, 2026 03:51
Cictrone
Cictrone previously approved these changes Feb 23, 2026
KCarretto and others added 5 commits February 22, 2026 23:06
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>
@KCarretto KCarretto disabled auto-merge February 23, 2026 04:26
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>
@KCarretto KCarretto closed this Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants