Skip to content

feat: add re-run button to runs table#1026

Open
Smeet23 wants to merge 1 commit intogetmaxun:developfrom
Smeet23:feat/rerun-button
Open

feat: add re-run button to runs table#1026
Smeet23 wants to merge 1 commit intogetmaxun:developfrom
Smeet23:feat/rerun-button

Conversation

@Smeet23
Copy link
Copy Markdown

@Smeet23 Smeet23 commented Apr 9, 2026

Summary

  • Adds a Re-run button (Replay icon) to each row in the runs table
  • Button only appears for completed runs (success, failed, aborted) — not for active or queued ones
  • Clicking re-triggers the same robot using its original interpreter settings (same maxConcurrency, maxRepeats, debug flags)
  • Navigates to the new run's page automatically, just like a fresh run
  • Translation key runs_table.rerun added for all 6 supported languages (en, de, es, ja, tr, zh)

Closes #687

Changes

  • ColapsibleRow.tsx — new rerun column case with Replay icon, only rendered for terminal run states
  • RunsTable.tsx — added rerun column definition and rerunHandler prop
  • Runs.tsx — threads rerunHandler prop down to RunsTable
  • MainPage.tsxhandleReRunRecording handler using existing createAndRunRecording API
  • public/locales/*.jsonruns_table.rerun key in all locales

Test plan

  • Create a robot and run it to completion
  • Verify the Replay icon appears on success, failed, and aborted runs
  • Verify the Replay icon does NOT appear on running or queued runs
  • Click Re-run and verify a new run starts and navigates to the run page
  • Verify the re-run uses the same settings as the original run
  • Check UI in a non-English locale to verify the column header is translated

Summary by CodeRabbit

  • New Features

    • Re-run completed recordings directly from the runs table via a new Re‑run button; queued runs show a “run queued” notification and active reruns navigate to the run details when started.
    • UI now recognizes SDK run type.
  • Internationalization

    • Added translations for the Re‑run action and SDK run type in German, Spanish, Japanese, Turkish, and Chinese.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d2f3027-9fc9-4dc3-84a1-f2905822cf05

📥 Commits

Reviewing files that changed from the base of the PR and between 29a0dad and 7d9424c.

📒 Files selected for processing (10)
  • public/locales/de.json
  • public/locales/en.json
  • public/locales/es.json
  • public/locales/ja.json
  • public/locales/tr.json
  • public/locales/zh.json
  • src/components/run/ColapsibleRow.tsx
  • src/components/run/Runs.tsx
  • src/components/run/RunsTable.tsx
  • src/pages/MainPage.tsx
🚧 Files skipped from review as they are similar to previous changes (8)
  • src/components/run/Runs.tsx
  • public/locales/en.json
  • public/locales/ja.json
  • src/pages/MainPage.tsx
  • src/components/run/ColapsibleRow.tsx
  • public/locales/zh.json
  • src/components/run/RunsTable.tsx
  • public/locales/es.json

Walkthrough

Adds a re-run feature: new i18n keys for multiple locales; a "rerun" column and button in the runs table; a propagated rerunHandler prop; and server interaction in MainPage to create/run recordings, handle queued vs immediate runs, listen for completion via Socket.IO, and navigate to the new run.

Changes

Cohort / File(s) Summary
Localization
public/locales/de.json, public/locales/en.json, public/locales/es.json, public/locales/ja.json, public/locales/tr.json, public/locales/zh.json
Added rerun translation entries (per-locale) and minor JSON structure adjustments; also added/confirmed runs_table.run_type_chips.sdk in some locales.
Runs table & rows
src/components/run/RunsTable.tsx, src/components/run/ColapsibleRow.tsx, src/components/run/Runs.tsx
Added 'rerun' column and label; expanded Column.id union; added rerunHandler prop to Runs, RunsTable, and CollapsibleRow; CollapsibleRow renders a Replay icon button for success/failed/aborted rows and invokes rerunHandler. Adjusted imports and an expanded-row colSpan.
Rerun orchestration
src/pages/MainPage.tsx
Implemented handleReRunRecording to call createAndRunRecording, handle queued vs immediate runs, establish Socket.IO listener for run-completed, invalidate runs cache, show notifications, and navigate to the new run. Includes error handling and queued-run state update.

Sequence Diagram

sequenceDiagram
    participant User
    participant UI as "RunsTable / CollapsibleRow"
    participant Main as "MainPage"
    participant API as "Backend API"
    participant Socket as "Socket.IO Server"

    User->>UI: Click Re-run button (status: success/failed/aborted)
    UI->>Main: rerunHandler(robotMetaId, robotName, interpreterSettings)
    Main->>API: createAndRunRecording(robotMetaId, interpreterSettings)
    API-->>Main: { queued, runId, browserId? }

    alt queued = true
        Main->>Main: Add runId to queuedRuns
        Main->>User: Show "run queued" notification
    else queued = false
        Main->>Main: Use browserId to open Socket.IO connection
        Main->>Socket: Listen for 'run-completed'
        Socket-->>Main: 'run-completed'(data.status)
        Main->>API: Invalidate runs cache
        alt data.status = success
            Main->>User: Show success notification
        else
            Main->>User: Show failure notification
        end
    end

    Main->>User: Navigate to /runs/{robotMetaId}/run/{runId}
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

Type: Feature, Scope: UI/UX

Suggested reviewers

  • amhsirak
  • RohitR311

Poem

🐰 I hopped to add a little rerun key,
A click, a zap, a replayed spree,
Sockets listen, logs go hum—
New runs start with a cheerful drum,
Little rabbit claps for CI! 🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Commit 1 adds unrelated i18n keys (runs_table.run_type_chips.sdk, right_panel.tooltips.capture_list_first) not tied to the re-run feature requirements in issue #687. Separate the unrelated i18n fixes (runs_table.run_type_chips.sdk and right_panel.tooltips) into a distinct PR addressing issue #651 instead of mixing them with the re-run feature.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat: add re-run button to runs table' is concise and directly describes the main feature addition in the changeset.
Linked Issues check ✅ Passed The PR implements all core requirements from issue #687: adds re-run button visible only for terminal states, preserves original interpreter settings, and navigates to new run page.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/run/ColapsibleRow.tsx`:
- Around line 214-227: The collapsed detail row's TableCell still uses a fixed
colSpan (colSpan={6}) which no longer matches the updated columns after adding
the 'rerun' column; update the TableCell that renders the expanded content in
ColapsibleRow.tsx to compute colSpan dynamically (e.g., colSpan={columns.length}
or colSpan={columns.filter(c => !c.hidden).length} if you track visibility)
instead of a hardcoded 6 so the expanded content spans the correct number of
columns; locate the TableCell with the colSpan prop in the collapsed content
rendering and replace the literal with the dynamic expression.
- Around line 218-223: The IconButton's aria-label is hardcoded ("rerun");
update ColapsibleRow.tsx to use the app's i18n translation function so
screen-readers get localized text: import/use the existing translation hook
(e.g. useTranslation/t) and change the IconButton prop aria-label to a
translated string (aria-label={t('rerun') or the appropriate key}), keeping the
onClick handler (rerunHandler(row.robotMetaId, row.name,
row.interpreterSettings)) intact so behavior is unchanged.

In `@src/components/run/RunsTable.tsx`:
- Line 29: The new "Re-run" column in RunsTable uses the wrong i18n key
namespace (it references runs_table.rerun) causing fallbacks; update the column
definition with id 'rerun' and any usages (e.g., the header label lookup and the
cell rendering around the rerun column) to use the existing translation key
runstable.rerun consistently (or alternatively add runs_table.rerun to the
locales), ensuring both the column descriptor and the render code reference the
same key.

In `@src/pages/MainPage.tsx`:
- Around line 229-265: In handleReRunRecording, validate the response from
createAndRunRecording (the CreateRunResponseWithQueue returned object) before
navigating or creating sockets: check that runId is non-empty (and for the
socket path that browserId is non-empty) and that queued is a boolean; if
runId/browserId are empty or queued is unexpectedly false for a failed response,
call notify('error', ...) and return early to avoid navigating to /run/ with an
empty id or opening sockets to `${apiUrl}/`. Also mirror the socket lifecycle
handlers from handleRunRecording by adding socket.on('connect_error', ...) and
socket.on('disconnect', ...) when you create the socket (the socket variable in
the non-queued path) so connection failures are handled and the socket is
cleaned up.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5062d0b4-ac59-4914-8816-fd58a128ba97

📥 Commits

Reviewing files that changed from the base of the PR and between bd818a5 and 29a0dad.

📒 Files selected for processing (10)
  • public/locales/de.json
  • public/locales/en.json
  • public/locales/es.json
  • public/locales/ja.json
  • public/locales/tr.json
  • public/locales/zh.json
  • src/components/run/ColapsibleRow.tsx
  • src/components/run/Runs.tsx
  • src/components/run/RunsTable.tsx
  • src/pages/MainPage.tsx

Comment thread src/components/run/ColapsibleRow.tsx
Comment thread src/components/run/ColapsibleRow.tsx Outdated
{ id: 'startedAt', label: 'Started At', minWidth: 80 },
{ id: 'finishedAt', label: 'Finished At', minWidth: 80 },
{ id: 'settings', label: 'Settings', minWidth: 80 },
{ id: 'rerun', label: 'Re-run', minWidth: 80 },
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix i18n namespace mismatch for the new Re-run column header.

The column is translated via runstable.rerun, but this PR adds runs_table.rerun; in non-English locales the header will fall back to "Re-run" instead of using localized text.

🔧 Proposed fix
 export const columns: readonly Column[] = [
   { id: 'runStatus', label: 'Status', minWidth: 80 },
   { id: 'name', label: 'Name', minWidth: 80 },
   { id: 'startedAt', label: 'Started At', minWidth: 80 },
   { id: 'finishedAt', label: 'Finished At', minWidth: 80 },
   { id: 'settings', label: 'Settings', minWidth: 80 },
   { id: 'rerun', label: 'Re-run', minWidth: 80 },
   { id: 'delete', label: 'Delete', minWidth: 80 },
 ];

 const translatedColumns = useMemo(() => 
   columns.map(column => ({
     ...column,
-    label: t(`runstable.${column.id}`, column.label)
+    label: t(
+      column.id === 'rerun' ? 'runs_table.rerun' : `runstable.${column.id}`,
+      column.label
+    )
   })),
   [t]
 );

Also applies to: 132-136

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/run/RunsTable.tsx` at line 29, The new "Re-run" column in
RunsTable uses the wrong i18n key namespace (it references runs_table.rerun)
causing fallbacks; update the column definition with id 'rerun' and any usages
(e.g., the header label lookup and the cell rendering around the rerun column)
to use the existing translation key runstable.rerun consistently (or
alternatively add runs_table.rerun to the locales), ensuring both the column
descriptor and the render code reference the same key.

Comment thread src/pages/MainPage.tsx Outdated
@RohitR311 RohitR311 requested a review from amhsirak April 10, 2026 13:57
Adds a Replay icon button in the runs table for completed runs
(success, failed, aborted). Clicking it re-triggers the same robot
with its original interpreter settings and navigates to the new run.

Changes:
- ColapsibleRow: add rerun case with Tooltip-wrapped Replay icon (terminal states only)
- ColapsibleRow: use columns.length for dynamic colSpan instead of hardcoded 6
- RunsTable: add rerun column, prop threading, fix useCallback deps
- Runs: thread rerunHandler prop
- MainPage: add handleReRunRecording with runId/browserId validation,
  connect_error/disconnect socket handlers, correct queued notify message
- Locales: add runstable.rerun and runs_table.rerun keys to all 6 languages

Closes getmaxun#687
@Smeet23 Smeet23 force-pushed the feat/rerun-button branch from 29a0dad to 7d9424c Compare April 12, 2026 08:39
@Smeet23
Copy link
Copy Markdown
Author

Smeet23 commented Apr 17, 2026

Hi team — just a gentle ping on this PR. All checks are passing. Would appreciate a review when you get a chance. Happy to address any feedback. Thanks!

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.

Feature: add re-run button for runs

2 participants