Skip to content

Feat/sandbox console logs - #39

Merged
devfoma merged 9 commits into
Ender-Stellar:mainfrom
AugistineCreates:feat/sandbox-console-logs
Jun 19, 2026
Merged

devfoma merged 9 commits into
Ender-Stellar:mainfrom
AugistineCreates:feat/sandbox-console-logs

Conversation

@AugistineCreates

Copy link
Copy Markdown
Contributor

This pr closes #16
This PR adds a new Console Log tab to the sandbox preview UI, allowing users to view real‑time logs generated by the sandboxed application. The feature is implemented as a premium‑styled component that polls the existing /api/sandbox-logs endpoint.

Changes

  1. New Component

    • components/SandboxConsoleLogs.tsx
    • Polls /api/sandbox-logs every 1.5 seconds.
    • Accumulates logs (capped at 500 lines) and displays them in a scrollable, glass‑morphism styled <pre> block.
    • Shows a loading spinner while the first fetch is in progress.
  2. Updated UI

    • components/SandboxPreview.tsx
    • Integrated Shadcn UI Tabs (Tabs, TabsList, TabsTrigger, TabsContent).
    • Added Preview and Console Log tabs.
    • The Console Log tab renders the new SandboxConsoleLogs component.
    • Adjusted imports and state handling to manage active tab selection.
    • Preserved existing preview controls (refresh, open in new tab) and loading states.
  3. Styling

    • Used existing dark theme classes with additional glass‑morphism (bg-gray-900/70 backdrop-blur-sm) for a premium look.
    • Monospaced font and smooth scroll for log readability.

Rationale

  • Sandbox console output was previously hidden, making debugging difficult for users.
  • Providing a dedicated UI panel improves visibility, reduces friction, and aligns with the product’s developer‑friendly experience.

Testing

  • Manual: Run the development server (npm run dev), open a sandbox preview, switch to the Console Log tab, and verify that errors or console.log statements from the sandbox appear in real time.
  • Automated: No new unit tests added, but the component was exercised manually; existing test suite passes (npm test).

Impact

  • No breaking changes to existing functionality.
  • Only UI additions; API contract for /api/sandbox-logs remains unchanged.
  • The new branch is set as upstream and ready for review.

@devfoma
devfoma merged commit 3b53684 into Ender-Stellar:main Jun 19, 2026
1 check passed
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.

frontend: Interactive Sandbox Console logs in UI

2 participants