Skip to content

(MOT-4257) feat(github,console): github page as injectable activity view - #609

Merged
rohitg00 merged 7 commits into
mainfrom
feat/github-injectable-ui
Jul 28, 2026
Merged

(MOT-4257) feat(github,console): github page as injectable activity view#609
rohitg00 merged 7 commits into
mainfrom
feat/github-injectable-ui

Conversation

@rohitg00

@rohitg00 rohitg00 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

What

Moves the github page to an injectable UI shipped by the github worker (per docs/sops/injectable-console-ui.md, state worker as the reference), and reworks it from the standalone owner/name browsing into a live activity feed of what the agent actually does with github. First of the console injectable-UI migration (MOT-4256): the console becomes a thin host with no per-worker UI.

Worker: github::called events

  • New github/src/events.rs: after every github function runs, the worker fires a fire-and-forget github::called event (registered as a trigger type via register_trigger_type + a SubscriberSet, matching the iii-directory / browser event pattern). Payload CalledEvent { function_id, args_summary, repo, ok, duration_ms, result_summary, timestamp }.
  • summarize(function_id, result) derives a short human result (e.g. "3 pull requests", "exit 0, 1.2 KB out", a created URL, "N B diff"), bounded to 512 chars. args_summary echoes the gh argv with --body/--input/-f values redacted (the auth token never rides argv).
  • run_and_emit threads through the three generic register helpers + passthrough, so all 32 functions are wrapped with no per-handler edits and no behavior/response change. 9 unit tests (summarize variants, arg redaction, and that emission preserves the wrapped return).

Injectable page: activity feed

  • Deleted the browsing panels (Prs/Issues/Runs/Releases/Search/PanelShell, github-data.ts, useGithubRead.ts, ModeToggle).
  • src/page/index.tsx rewritten: one tab-scoped github::called subscription (registerTrigger({ type, function_id: EVENTS_FN::browserId }) + on(...), the state-worker idiom), a bounded newest-first list (cap 200), a row per call (function-id badge, arg echo + repo, ok/error + duration, relative timestamp; click to expand the result summary), plus clear + live/paused. @iii-dev/console-ui components only.
  • styles.css rescoped to the activity classes under [data-iii-ui="github"].

Verification

  • worker: cargo build / fmt / clippy / test (36 pass, incl. 9 new events tests).
  • ui: tsc + esbuild build clean.
  • console: tsc -b exit 0. Console purged of the github page (pages/Github/, lib/github.ts, use-github-status, nav/routing all removed).
  • Includes the CodeRabbit fix: cargo:rerun-if-env-changed=SKIP_UI_BUILD in build.rs.

Follow-up

Repo diffs via the shell worker (show a fetched repo's diff in the feed) land as a fast-follow. Closes MOT-4257.

Summary by CodeRabbit

  • New Features
    • Added a GitHub workspace with an interactive commit graph and an activity feed.
    • View commit details, diffs, and per-call result previews, with expandable rows, pause/clear controls, and responsive loading/error states.
  • Updates
    • Removed the former first-party GitHub page and its navigation entry.
    • Updated routing/hash handling to redirect legacy GitHub hashes into the injected GitHub workspace (graph/activity) experience.

Move the github page from console-native to the github worker's ui/,
following the injectable-console-ui SOP (state/database precedent). The
page now ships into every running console at runtime as #/ext/github and
appears in the nav whenever the github worker is connected, via the same
ext-pages mechanism the database and iii-directory workers already use.

github/ui/:
- page.tsx setup(host) registers the github page (owner/name input plus
  the pull-requests, issues, runs, releases, and search panels). Panels
  read github::* over host.iii.trigger and unwrap the worker's { value }
  envelope; function ids and payloads are kept verbatim from the console
  wrappers. Components are named imports from @iii-dev/console-ui; icons
  are hand-drawn inline SVG (no lucide-react); the segmented control is a
  local ModeToggle.
- styles.css scopes every rule under [data-iii-ui="github"] and colors
  from the console design tokens.
- build.mjs / package.json / tsconfig.json esbuild scaffold with the five
  shared specifiers external (react family + @iii-dev/console-ui).

github worker (Rust):
- src/ui.rs registers the two assets through the iii-console-ui crate
  (ConsoleUi::new("github")), embedded via include_str! and called from
  main.rs after the github::* functions register.
- build.rs builds ui/ (respects SKIP_UI_BUILD=1); iii-console-ui path dep
  added to Cargo.toml; the client is Arc-wrapped for the UI watcher.

console cleanup:
- delete src/pages/Github/, lib/github.ts, and use-github-status (the
  presence hook only served the page).
- remove the github nav entry, hash route, and githubAvailable plumbing
  from App.tsx, nav-options, use-hash-route, and conversations-context.
- chat function-call renderers are untouched (none exist on this branch).
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jul 28, 2026 2:50pm
workers-tech-spec Ready Ready Preview, Comment Jul 28, 2026 2:50pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 49 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@rohitg00, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 88f32445-fdb0-40c3-b9c6-b61e96f3a7af

📥 Commits

Reviewing files that changed from the base of the PR and between a5d408f and ee1a484.

📒 Files selected for processing (5)
  • github/src/events.rs
  • github/ui/src/page/GitGraph.tsx
  • github/ui/src/page/index.tsx
  • github/ui/src/page/result-views.tsx
  • github/ui/styles.css
📝 Walkthrough

Walkthrough

The legacy console GitHub route and availability plumbing are removed. The GitHub worker now builds and registers an injectable UI with a live call-event feed, git graph, expandable result previews, and scoped styling.

Changes

GitHub UI migration

Layer / File(s) Summary
Remove legacy console GitHub route
console/web/src/App.tsx, console/web/src/hooks/*, console/web/src/lib/*
Removes the legacy GitHub route, navigation option, availability context, and status wiring while redirecting #/github to the injected page.
Build and register worker UI
github/Cargo.toml, github/build.rs, github/src/{lib,main,ui}.rs, github/ui/*, pnpm-workspace.yaml
Adds the UI workspace package, freshness-aware asset build, embedded page/style assets, and worker registration under the github namespace.
Instrument GitHub calls with events
github/src/events.rs, github/src/functions/*, github/src/main.rs
Adds the github::called trigger, bounded/redacted payload generation, subscriber fan-out, and event-wrapped execution for registered GitHub functions.
Create graph data and injected page foundation
github/ui/src/page/{GithubPage,GitGraph,events,graph-layout}.*
Adds graph and activity tabs, trigger subscriptions, git log parsing, lane layout, commit selection, and diff retrieval.
Render activity and graph results
github/ui/src/page/{index,result-views,icons,format}.*, github/ui/styles.css
Adds the bounded activity feed, expandable result renderers, shared icons, relative time formatting, and scoped responsive styles.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers: andersonleal

Poem

A rabbit watched the GitHub calls,
Then hopped through graphs and feed-filled halls.
Events now sparkle, bounded and bright,
While tabs bloom in injected light.
“No old route!” cried Bun with delight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: moving the GitHub page into an injectable activity view and touching both github and console code.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/github-injectable-ui

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.

@rohitg00 rohitg00 added the no-ticket PR deliberately has no Linear ticket (bump/typo/CI-only) label Jul 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@github/build.rs`:
- Around line 13-24: Add SKIP_UI_BUILD to the Cargo rerun inputs in main, using
cargo:rerun-if-env-changed alongside the existing rerun directives so changes to
that environment variable rerun the build script and refresh embedded UI assets.

In `@github/ui/src/page/index.tsx`:
- Around line 38-41: Stop using the refresh counter to force-remount the active
panel via the key in the page render flow. Thread a refresh signal or callback
from the refresh control through the panel components, including SearchPanel,
PrsPanel, and IssuesPanel, and invoke each panel’s useGithubRead refresh()
closure so data refetches while preserving query, filter, and expanded-row
state.
🪄 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 Plus

Run ID: 7f3cac6f-6a76-47e3-9052-4783ac378b7e

📥 Commits

Reviewing files that changed from the base of the PR and between a88137b and bcb47d5.

⛔ Files ignored due to path filters (2)
  • github/Cargo.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (31)
  • console/web/src/App.tsx
  • console/web/src/hooks/use-github-status.test.ts
  • console/web/src/hooks/use-github-status.ts
  • console/web/src/hooks/use-hash-route.ts
  • console/web/src/lib/conversations-context.tsx
  • console/web/src/lib/github.test.ts
  • console/web/src/lib/nav-options.test.ts
  • console/web/src/lib/nav-options.ts
  • console/web/src/pages/Github/index.tsx
  • github/Cargo.toml
  • github/build.rs
  • github/src/lib.rs
  • github/src/main.rs
  • github/src/ui.rs
  • github/ui/build.mjs
  • github/ui/package.json
  • github/ui/page.tsx
  • github/ui/src/page/IssuesPanel.tsx
  • github/ui/src/page/ModeToggle.tsx
  • github/ui/src/page/PanelShell.tsx
  • github/ui/src/page/PrsPanel.tsx
  • github/ui/src/page/ReleasesPanel.tsx
  • github/ui/src/page/RunsPanel.tsx
  • github/ui/src/page/SearchPanel.tsx
  • github/ui/src/page/github-data.ts
  • github/ui/src/page/icons.tsx
  • github/ui/src/page/index.tsx
  • github/ui/src/page/useGithubRead.ts
  • github/ui/styles.css
  • github/ui/tsconfig.json
  • pnpm-workspace.yaml
💤 Files with no reviewable changes (7)
  • console/web/src/hooks/use-github-status.test.ts
  • console/web/src/pages/Github/index.tsx
  • console/web/src/hooks/use-github-status.ts
  • console/web/src/lib/nav-options.ts
  • console/web/src/lib/github.test.ts
  • console/web/src/lib/conversations-context.tsx
  • console/web/src/hooks/use-hash-route.ts

Comment thread github/build.rs
Comment thread github/ui/src/page/index.tsx Outdated
@rohitg00 rohitg00 changed the title feat(github,console): ship the github page as injectable console UI (MOT-4257) feat(github,console): github page as injectable activity view Jul 28, 2026
@rohitg00

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (3)
github/ui/src/page/index.tsx (1)

137-179: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

<tr role="button"> overrides native row semantics.

The row keeps <td> children but overrides its implicit "row" role to "button," which can break table navigation semantics for screen readers. Consider keeping the row's native role and moving the interactive semantics to a focusable element inside a cell (e.g., a full-width button in the first <td>), while the <tr> retains role="row".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@github/ui/src/page/index.tsx` around lines 137 - 179, Update ActivityRow so
the <tr> retains native table semantics (role="row" or no explicit role) and is
not itself focusable or interactive. Move the click, keyboard, focus, and
expanded-state behavior to a focusable full-width button inside the first cell,
preserving onToggle behavior and the existing row contents.
github/ui/src/page/GitGraph.tsx (2)

424-451: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Unbounded git show diff rendered without a size cap.

CommitDetail feeds a raw, un-truncated (beyond the shell worker's own general cap) diff into DiffView, which renders one <div> per line with no cap — a large commit could produce a very large DOM. Shares one root cause with result-views.tsx DiffView; see the consolidated comment.

Also applies to: 462-469

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@github/ui/src/page/GitGraph.tsx` around lines 424 - 451, Cap the git show
output before CommitDetail passes it to DiffView, using the existing truncation
handling and a defined maximum size so large commits cannot create an unbounded
DOM. Update the success path in the useEffect around host.trigger and the
corresponding CommitDetail rendering path, while preserving status, error, and
truncated-result behavior.

424-469: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Unbounded git show diff rendered through a renderer sized for small, budgeted previews. DiffView was designed for the worker's small, PREVIEW_MAX_BYTES-capped result_preview (per result-views.tsx's file header), but GitGraph.tsx's CommitDetail is the only caller feeding it a raw git show --stat --patch diff bounded only by the shell worker's own general truncation — a large commit could render thousands of uncapped <div> lines.

  • github/ui/src/page/GitGraph.tsx#L424-L469: cap or truncate text client-side (e.g., first N lines) before passing it to ResultView, or request a smaller/paginated diff from the shell worker.
  • github/ui/src/page/result-views.tsx#L195-L211: add a defensive line cap inside DiffView itself (with a "…truncated" marker, mirroring the existing truncated flag handling) so any caller is protected regardless of input size.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@github/ui/src/page/GitGraph.tsx` around lines 424 - 469, Cap the raw git show
output in CommitDetail before passing it to ResultView, and add a defensive line
cap in DiffView with a visible “…truncated” marker while preserving the existing
truncated flag behavior. Apply the caller change in
github/ui/src/page/GitGraph.tsx at lines 424-469 and the renderer safeguard in
github/ui/src/page/result-views.tsx at lines 195-211.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@github/src/events.rs`:
- Around line 339-347: Update preview_list and the related preview handling
around the referenced lines to enforce PREVIEW_MAX_BYTES as an aggregate
serialized-byte budget, stopping before adding another projected item once the
budget is exhausted. Preserve the total count and existing item projection
rules, while ensuring the returned list preview remains within the documented 6
KB limit.
- Around line 157-186: Detach the fan-out from the real call in run_and_emit by
spawning emit without awaiting it, and return result immediately. Preserve
emit’s existing subscriber discovery, serialization, and warning behavior;
ensure the detached task owns the event/emitter data it needs so slow or wedged
subscribers cannot delay or fail the caller.
- Around line 584-623: Update summarize_args to recognize inline-value forms for
--body=, --body-file=, --input=, --field=, --raw-field=, and --json= before the
fallback arm, preserving field keys while redacting values and redacting
body/input values entirely. Update repo_from_args to return the suffix from
--repo= using strip_prefix, while preserving existing separate-argument
handling.

In `@github/ui/src/page/GitGraph.tsx`:
- Around line 369-386: Update the keydown handlers in CommitRow in
github/ui/src/page/GitGraph.tsx (lines 369-386) and the corresponding handler in
github/ui/src/page/index.tsx (lines 137-153) to use the native DOM KeyboardEvent
type, or explicitly import React’s event type with a type-only import. Keep the
existing Enter and Space handling unchanged.

In `@github/ui/styles.css`:
- Around line 208-211: Replace the deprecated word-break: break-word
declarations in the .gh-rv-title and the other flagged GitHub UI selectors with
the supported overflow-wrap: anywhere behavior, preserving the existing
text-wrapping intent.
- Around line 90-96: Update the `.gh-feed-args` and `.gh-feed-status` table-cell
styles to retain `display: table-cell` (or the existing table-cell behavior)
instead of `display: flex`; move the flex layout properties to inner wrapper
elements around each cell’s contents, preserving the existing alignment, gap,
and overflow behavior.

---

Nitpick comments:
In `@github/ui/src/page/GitGraph.tsx`:
- Around line 424-451: Cap the git show output before CommitDetail passes it to
DiffView, using the existing truncation handling and a defined maximum size so
large commits cannot create an unbounded DOM. Update the success path in the
useEffect around host.trigger and the corresponding CommitDetail rendering path,
while preserving status, error, and truncated-result behavior.
- Around line 424-469: Cap the raw git show output in CommitDetail before
passing it to ResultView, and add a defensive line cap in DiffView with a
visible “…truncated” marker while preserving the existing truncated flag
behavior. Apply the caller change in github/ui/src/page/GitGraph.tsx at lines
424-469 and the renderer safeguard in github/ui/src/page/result-views.tsx at
lines 195-211.

In `@github/ui/src/page/index.tsx`:
- Around line 137-179: Update ActivityRow so the <tr> retains native table
semantics (role="row" or no explicit role) and is not itself focusable or
interactive. Move the click, keyboard, focus, and expanded-state behavior to a
focusable full-width button inside the first cell, preserving onToggle behavior
and the existing row contents.
🪄 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 Plus

Run ID: 9afe3857-4e17-4a63-b1a0-56c767cd1f9d

📥 Commits

Reviewing files that changed from the base of the PR and between bcb47d5 and b7b9524.

⛔ Files ignored due to path filters (1)
  • github/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (19)
  • github/Cargo.toml
  • github/build.rs
  • github/src/events.rs
  • github/src/functions/mod.rs
  • github/src/functions/passthrough.rs
  • github/src/lib.rs
  • github/src/main.rs
  • github/src/ui.rs
  • github/ui/page.tsx
  • github/ui/src/page/GitGraph.tsx
  • github/ui/src/page/GithubPage.tsx
  • github/ui/src/page/events.ts
  • github/ui/src/page/format.ts
  • github/ui/src/page/graph-layout.test.ts
  • github/ui/src/page/graph-layout.ts
  • github/ui/src/page/icons.tsx
  • github/ui/src/page/index.tsx
  • github/ui/src/page/result-views.tsx
  • github/ui/styles.css
🚧 Files skipped from review as they are similar to previous changes (5)
  • github/Cargo.toml
  • github/src/lib.rs
  • github/ui/page.tsx
  • github/src/ui.rs
  • github/build.rs

Comment thread github/src/events.rs
Comment thread github/src/events.rs
Comment thread github/src/events.rs
Comment thread github/ui/src/page/GitGraph.tsx
Comment thread github/ui/styles.css
Comment thread github/ui/styles.css
…e-ui

# Conflicts:
#	console/web/src/App.tsx
#	console/web/src/hooks/use-hash-route.ts
#	console/web/src/lib/nav-options.test.ts
#	console/web/src/lib/nav-options.ts
#	pnpm-lock.yaml
#	pnpm-workspace.yaml
@rohitg00

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@console/web/src/hooks/use-hash-route.ts`:
- Around line 141-146: Move the normalizeExtHash/replaceHash logic from the
mount-only path into the hashchange handler so every navigation event rewrites
legacy hashes such as `#/github` to the corresponding `#/ext/`<id> URL. Preserve the
existing normalized view-state resolution and avoid relying solely on the
initial mount normalization.
🪄 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 Plus

Run ID: 11180496-174b-4f94-8b1f-7a772d195791

📥 Commits

Reviewing files that changed from the base of the PR and between b7b9524 and a5d408f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • console/web/src/App.tsx
  • console/web/src/hooks/use-hash-route.test.ts
  • console/web/src/hooks/use-hash-route.ts
  • console/web/src/lib/conversations-context.tsx
  • console/web/src/lib/nav-options.test.ts
  • console/web/src/lib/nav-options.ts
  • pnpm-workspace.yaml
💤 Files with no reviewable changes (1)
  • console/web/src/lib/conversations-context.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • pnpm-workspace.yaml
  • console/web/src/App.tsx

Comment on lines +141 to 146
// Rewrite a legacy migrated hash (`#/worktrees`, `#/memory`, `#/browser`,
// `#/github`) to its `#/ext/<id>` form so the URL bar matches the resolved
// page. The view
// state already used the normalized hash, so this is cosmetic.
const normalized = normalizeExtHash(window.location.hash)
if (normalized !== window.location.hash) replaceHash(normalized)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Normalize migrated hashes on every hash change.

The rewrite runs only on mount. Later navigation to #/github resolves the ext view but leaves the legacy hash in the URL bar. Move normalization into the hashchange handler too.

Proposed fix
 useEffect(() => {
-  const normalized = normalizeExtHash(window.location.hash)
-  if (normalized !== window.location.hash) replaceHash(normalized)
-  const handle = () => {
-    const next = routeFromHash(window.location.hash)
+  const handle = () => {
+    const normalized = normalizeExtHash(window.location.hash)
+    if (normalized !== window.location.hash) replaceHash(normalized)
+    const next = routeFromHash(normalized)
     if (next !== null && next !== viewRef.current) setView(next)
   }
+  handle()
   window.addEventListener('hashchange', handle)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Rewrite a legacy migrated hash (`#/worktrees`, `#/memory`, `#/browser`,
// `#/github`) to its `#/ext/<id>` form so the URL bar matches the resolved
// page. The view
// state already used the normalized hash, so this is cosmetic.
const normalized = normalizeExtHash(window.location.hash)
if (normalized !== window.location.hash) replaceHash(normalized)
const handle = () => {
const normalized = normalizeExtHash(window.location.hash)
if (normalized !== window.location.hash) replaceHash(normalized)
const next = routeFromHash(normalized)
if (next !== null && next !== viewRef.current) setView(next)
}
handle()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@console/web/src/hooks/use-hash-route.ts` around lines 141 - 146, Move the
normalizeExtHash/replaceHash logic from the mount-only path into the hashchange
handler so every navigation event rewrites legacy hashes such as `#/github` to the
corresponding `#/ext/`<id> URL. Preserve the existing normalized view-state
resolution and avoid relying solely on the initial mount normalization.

Address CodeRabbit review on PR #609: redact inline --flag=value args (body/field/input) and recognize --repo= inline; enforce an aggregate byte budget on list previews; cap DiffView rendering at 500 lines; use type-only KeyboardEvent imports; move flex off table cells to inner wrappers; replace deprecated word-break: break-word with overflow-wrap: anywhere.
@rohitg00
rohitg00 merged commit 6bf9456 into main Jul 28, 2026
19 checks passed
@rohitg00
rohitg00 deleted the feat/github-injectable-ui branch July 28, 2026 14:53
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.

1 participant