Skip to content

fix: remove Review plus button - #88

Closed
Astro-Han wants to merge 1 commit into
devfrom
codex/fix-review-plus-button
Closed

fix: remove Review plus button#88
Astro-Han wants to merge 1 commit into
devfrom
codex/fix-review-plus-button

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Apr 21, 2026

Copy link
Copy Markdown
Owner

Summary

Remove the standalone file-open plus button while the Review tab is active.

Why

The Review Git changes surface should only show actions that are meaningful for the review workflow. The extra plus button could be clicked by mistake and had no clear purpose in that state.

Related Issue

Fixes #85

How To Verify

cd packages/app
bun test src/pages/session/session-side-panel.test.tsx
bun run typecheck

Fresh-eyes review was run twice. The final review reported no Critical, Important, or Minor issues.

Screenshots or Recordings

Not attached. This environment did not run a manual desktop UI capture.

Checklist

  • I ran the relevant verification steps
  • I tested visible changes manually when needed
  • I am targeting the dev branch

Summary by CodeRabbit

  • Bug Fixes

    • Refined the file open button visibility behavior to prevent display when the review tab is active.
  • Refactor

    • Centralized the file open button rendering logic for improved maintainability and consistency.
  • Tests

    • Added test coverage for file open button visibility conditions across different tab states.

@Astro-Han Astro-Han added bug Something isn't working P2 Medium priority ui Design system and user interface labels Apr 21, 2026
@coderabbitai

coderabbitai Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A new helper function shouldShowReviewFileOpenButton is introduced to control the visibility of the "file open" button based on the active tab. The function returns false for the Review tab and true for all other tabs. This logic is then applied to refactor two inline button renderings into a centralized JSX helper, with corresponding test coverage added.

Changes

Cohort / File(s) Summary
Review Tab Button Visibility Logic
packages/app/src/pages/session/session-side-panel.tsx, packages/app/src/pages/session/session-side-panel.test.tsx
Introduced shouldShowReviewFileOpenButton helper to hide the "file open" button in Review tab. Refactored two inline button blocks to use a fileOpenButton() JSX helper that conditionally renders based on the new logic. Added test suite verifying the helper returns false for "review" tab and true for other tabs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

app

Poem

🐰 A button hops away from review's careful gaze,
While other tabs enjoy its helpful rays,
One helper function, clean and neat,
Makes the UI logic sweet! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR implements the first requirement from issue #85 (remove the standalone '+' button from Review Git changes), but does not address the second requirement (localize 'Git changes' heading) or third requirement (remove unified/split toggle support). Complete the remaining requirements from issue #85: localize the Git changes heading to Chinese and remove the unified/split toggle to use only unified diff mode.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: remove Review plus button' directly and specifically describes the main change: removing the plus button from the Review tab interface.
Description check ✅ Passed The description covers Summary, Why, Related Issue, How To Verify, and Checklist sections with substantial detail; Screenshots/Recordings notes that none were attached, which is acceptable for non-visual code changes.
Out of Scope Changes check ✅ Passed All changes in the PR are directly scoped to the button removal requirement; no out-of-scope modifications to unrelated features or logic are present.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-review-plus-button

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

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces logic to conditionally hide the file-open button in the session side panel when the 'review' tab is active, supported by new unit tests. The implementation refactors the button into a reusable helper function to reduce duplication. Feedback suggests refactoring this helper function into a standard SolidJS component to better align with idiomatic practices and maintain consistency with the rest of the codebase.

Comment on lines +195 to +214
const fileOpenButton = (className: string) => (
<Show when={shouldShowReviewFileOpenButton(activeTab())}>
<div class={className}>
<TooltipKeybind
title={language.t("command.file.open")}
keybind={command.keybind("file.open")}
class="flex items-center"
>
<IconButton
icon="plus-small"
variant="ghost"
iconSize="large"
class="!rounded-md"
onClick={() => openFilePicker(showAllFiles)}
aria-label={language.t("command.file.open")}
/>
</TooltipKeybind>
</div>
</Show>
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

In SolidJS, it is more idiomatic to define reusable UI pieces as components (capitalized) rather than functions that return JSX. This improves readability and follows the project's convention (e.g., RightPanelShellIcon). Additionally, using the class prop name is more consistent with SolidJS than className.

Suggested change
const fileOpenButton = (className: string) => (
<Show when={shouldShowReviewFileOpenButton(activeTab())}>
<div class={className}>
<TooltipKeybind
title={language.t("command.file.open")}
keybind={command.keybind("file.open")}
class="flex items-center"
>
<IconButton
icon="plus-small"
variant="ghost"
iconSize="large"
class="!rounded-md"
onClick={() => openFilePicker(showAllFiles)}
aria-label={language.t("command.file.open")}
/>
</TooltipKeybind>
</div>
</Show>
)
const FileOpenButton = (props: { class: string }) => (
<Show when={shouldShowReviewFileOpenButton(activeTab())}>
<div class={props.class}>
<TooltipKeybind
title={language.t("command.file.open")}
keybind={command.keybind("file.open")}
class="flex items-center"
>
<IconButton
icon="plus-small"
variant="ghost"
iconSize="large"
class="!rounded-md"
onClick={() => openFilePicker(showAllFiles)}
aria-label={language.t("command.file.open")}
/>
</TooltipKeybind>
</div>
</Show>
)

/>
</TooltipKeybind>
</div>
fileOpenButton("w-full bg-background-stronger flex items-center justify-end px-3 py-1.5")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Use the refactored FileOpenButton component here.

Suggested change
fileOpenButton("w-full bg-background-stronger flex items-center justify-end px-3 py-1.5")
<FileOpenButton class="w-full bg-background-stronger flex items-center justify-end px-3 py-1.5" />

Comment on lines +370 to +372
{fileOpenButton(
"bg-background-stronger h-full shrink-0 sticky right-0 z-10 flex items-center justify-center pr-3",
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Use the refactored FileOpenButton component here.

Suggested change
{fileOpenButton(
"bg-background-stronger h-full shrink-0 sticky right-0 z-10 flex items-center justify-center pr-3",
)}
<FileOpenButton
class="bg-background-stronger h-full shrink-0 sticky right-0 z-10 flex items-center justify-center pr-3"
/>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/app/src/pages/session/session-side-panel.test.tsx (1)

148-162: Add an undefined test case to match the helper contract.

shouldShowReviewFileOpenButton accepts string | undefined, but tests currently cover only string inputs. Adding undefined keeps the public helper contract explicit.

Proposed test addition
 describe("shouldShowReviewFileOpenButton", () => {
   test("hides the file-open button while the Review tab is active", async () => {
     const { shouldShowReviewFileOpenButton } = await import("./session-side-panel")

     expect(shouldShowReviewFileOpenButton("review")).toBe(false)
   })

   test("keeps the file-open button for non-review tabs in the same panel", async () => {
     const { shouldShowReviewFileOpenButton } = await import("./session-side-panel")

     expect(shouldShowReviewFileOpenButton("empty")).toBe(true)
     expect(shouldShowReviewFileOpenButton("context")).toBe(true)
     expect(shouldShowReviewFileOpenButton("file:///tmp/example.ts")).toBe(true)
+    expect(shouldShowReviewFileOpenButton(undefined)).toBe(true)
   })
 })
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/app/src/pages/session/session-side-panel.test.tsx` around lines 148
- 162, Tests for shouldShowReviewFileOpenButton only cover string inputs but the
function signature accepts string | undefined; add a test case calling
shouldShowReviewFileOpenButton(undefined) and assert the expected boolean
(likely true or false per helper contract) to make the test suite match the
public contract. Locate the helper import in session-side-panel.test.tsx (the
existing tests that import shouldShowReviewFileOpenButton) and add a third test
assertion that passes undefined and checks the correct return value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/app/src/pages/session/session-side-panel.test.tsx`:
- Around line 148-162: Tests for shouldShowReviewFileOpenButton only cover
string inputs but the function signature accepts string | undefined; add a test
case calling shouldShowReviewFileOpenButton(undefined) and assert the expected
boolean (likely true or false per helper contract) to make the test suite match
the public contract. Locate the helper import in session-side-panel.test.tsx
(the existing tests that import shouldShowReviewFileOpenButton) and add a third
test assertion that passes undefined and checks the correct return value.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e5f9bb2d-97e5-4fa6-9c06-09bc8e721c1f

📥 Commits

Reviewing files that changed from the base of the PR and between 6947d7b and 16217c6.

📒 Files selected for processing (2)
  • packages/app/src/pages/session/session-side-panel.test.tsx
  • packages/app/src/pages/session/session-side-panel.tsx

@Astro-Han

Copy link
Copy Markdown
Owner Author

Closing because #85 was updated with additional required changes. I will open a fresh PR covering the updated scope.

@Astro-Han Astro-Han closed this Apr 21, 2026
@Astro-Han
Astro-Han deleted the codex/fix-review-plus-button branch April 21, 2026 08:04
Astro-Han added a commit that referenced this pull request Jul 27, 2026
Root cause:
- The repository pinned vulnerable parser, site, updater, packaging, router, CSS-processing, glob-expansion, and native image-processing dependencies.
- The remaining brace-expansion advisory had no compatible backport for the older minimatch releases retained by lint and packaging tooling.

Change boundary:
- Upgrade pypdf and Astro to patched releases.
- Override vulnerable site and root transitive dependencies to patched versions.
- Upgrade electron-updater and the Electron Builder family together, including the explicit Windows Squirrel peer.
- Resolve every brace-expansion chain to 5.0.8 and patch only its CommonJS export shape so minimatch 3, 5, and 9 remain callable while minimatch 10 retains the named expand export.
- Add a compatibility regression test covering every installed minimatch release.

Verification:
- Root and site Bun audits report zero high or critical findings.
- Frozen installs, site production build, desktop typecheck, root lint, desktop production build, and a real macOS Electron startup passed.
- PDF parser smoke passed with pypdf and pdfplumber.
- Targeted desktop updater and packaging tests passed.
- Full PR CI passed across macOS, Windows, E2E, CodeQL, dependency review, and CodeRabbit.

Review follow-ups and residual risk:
- No unresolved review threads remain.
- sharp 0.35.3 is intentionally forced above Astro 6.4.6's optional range. The site does not use astro:assets and its production build passes; revisit this constraint if the image pipeline is adopted.
- Full signed installer production remains release-pipeline coverage.

Related work:
- No product issue. This work was driven by Dependabot alerts #88, #87, and #46 plus the repository-wide Bun audit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working P2 Medium priority ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Polish Review Git changes controls and localization

1 participant