Skip to content

Various hot fixes - #135

Merged
LinceMathew merged 4 commits into
masterfrom
various-hot-fixes
Oct 17, 2026
Merged

LinceMathew merged 4 commits into
masterfrom
various-hot-fixes

Conversation

@LinceMathew

@LinceMathew LinceMathew commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes and polish found while testing the auto-approve release (v1.0.11) on prod and the self-hosted instance.

Auto-approve

  • On by default: every org now gets a default auto-approve policy. A migration backfills existing orgs, and a trigger on orgs covers new ones. Before this, the settings page only showed defaults, nothing was saved, and reviews got "No policy evaluation".
  • Manual PR reviews run the policy too: reviews started from New Review (pasted PR URL) or the Explore PR table now get the policy check, the Auto Approve tab, and the red dot, the same as the PR description link. Reviewer-assignment and @mention reviews are unchanged.
  • PR description: the section keeps the two review links. A new line under the decisions table reads "Customize risk-based approval policy for this repository or your organization".

Fixes

  • Connector delete failed when a repo had an override policy: auto_approve_policies.repository_id had no ON DELETE CASCADE. A new migration adds it.
  • Explore → Merge Requests: Trigger Review now opens the new review page instead of showing a "See Logs" button.

UI

  • New Review redesign:
    • one box for a PR URL, or a repo name, PR title or author
    • typing shows matching open PRs (click, or ↑/↓ and Enter, to start a review)
    • provider chips below the box
    • an "Other ways to review" section: On the PR, Pre-commit CLI, IDE / MCP, CI/CD & API, Chatbot, Scheduled
  • Back buttons standardized: a new Icons.Back arrow, top left and lined up with the page title, across connectors, connector details, review detail, repo settings, scheduled pages, CLI/MCP pages, checkout and licenses. Some of these used a plus or dashboard icon before.
  • Route docs updated: new-review.md, pr-review-link.md, merge-requests.md.

Linked Issue

None. These came out of prod and self-hosted testing of v1.0.11.

Validation

  • go build ./internal/... and go vet (internal/api, internal/jobqueue, internal/policyengine) pass.
  • npx tsc --noEmit passes.
  • Not run yet: the two migrations against a DB, and go test ./internal/policyengine/ (the test helpers were updated for the new trigger).
  • Connector delete: confirmed the root cause on prod. Deleting the blocking policy row made DELETE /connectors/66 succeed. The migration itself wasn't run there.

Checklist

  • This PR fulfills an agreed issue.
  • I kept the change narrow and scoped.
  • I ran the most specific relevant validation and described it above.
  • If I changed behavior, I called that out clearly in this PR.
  • If I touched UI, I attached a GIF or video walkthrough. This is required.
  • If this change touches security, disclosure flow, credentials, storage, network behavior, or licensing/entitlement enforcement, I reviewed SECURITY.md and updated related documentation if needed.
  • I have read and accept the Contributor License Agreement.

Notes For Reviewers

  • Behavior change for every org: once deployed, reviews started from the PR link, New Review or the Explore table will post an approve or block verdict on the PR. The v1.0.11 release notes said "off until an org creates a policy", so the v1.0.12 notes need to say it's on by default.
  • auto_approve_policies.org_id still has no cascade, so a hard org delete would now be blocked by the default row. App code only soft-deletes orgs. Test cleanups in other packages delete orgs with _, _ =, so they will quietly leave test orgs behind.
  • Searching New Review by PR number (#12) doesn't match, because the backend searches only title, author and repo.
  • DeleteConnector accepts API keys, although the project rules say destructive endpoints should be session-only. This isn't changed here.

🔍 LiveReview

Every org gets a default auto-approve policy (backfill plus an orgs insert trigger).
Repo override policies now cascade when a repo is deleted, so deleting a connector no longer fails.

LiveReview Pre-Commit Check: vouched (iter:1, coverage:0%)
Reviews started from New Review or the Explore PR table now get the policy check and Auto Approve tab.
Trigger Review in Explore opens the new review; the PR description links to repo and org policy under the decisions table.

LiveReview Pre-Commit Check: vouched (iter:1, coverage:0%)
New Review searches open PRs by repo, title or author and lists other ways to review.
All back buttons use one Icons.Back arrow, placed top left and aligned with the title.

LiveReview Pre-Commit Check: vouched (iter:1, coverage:0%)
@LiveReview-Bot

Copy link
Copy Markdown

Implement Default Auto-Approve Policies and Policy Check Triggering

Overview

This change implements default auto-approve policies for all organizations. It also centralizes logic to trigger policy checks for reviews. This ensures consistent auto-approval behavior.

Technical Highlights

  • db/migrations/*, db/schema.sql: Introduces cascading deletes for auto-approve policies. Creates a trigger to provision default policies for new organizations.
  • internal/api/pull_request_review_trigger.go: Adds markForPolicyCheck function to flag reviews for policy checks. Replaces inline SQL with function calls.
  • internal/docindex/docs/*: Updates documentation to reflect new auto-approve policy check behavior for reviews.
  • ui/src/components/UIPrimitives.tsx, ui/src/*: Adds a new 'Back' SVG icon. Updates various UI components to use this icon for consistent navigation.
  • ui/src/pages/Reviews/NewReview.tsx: Refactors the New Review page. Introduces PR suggestion UI and improves review triggering flow.

Impact

  • Functionality: Auto-approve policies are now enabled by default for all organizations. Reviews trigger policy checks automatically.
  • Risk: Changes to review triggering logic may impact existing workflows. Documentation updates are crucial for user understanding.


-- Deleting a connector cascades to its repositories; repo override policies blocked that.
-- A repo's override policy is meaningless without the repo, so delete it too.
ALTER TABLE auto_approve_policies DROP CONSTRAINT auto_approve_policies_repository_id_fkey;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The existing foreign key constraint has been removed.

Suggestions:

  1. Consider adding a comment explaining why the existing constraint is being dropped.

-- Deleting a connector cascades to its repositories; repo override policies blocked that.
-- A repo's override policy is meaningless without the repo, so delete it too.
ALTER TABLE auto_approve_policies DROP CONSTRAINT auto_approve_policies_repository_id_fkey;
ALTER TABLE auto_approve_policies ADD CONSTRAINT auto_approve_policies_repository_id_fkey

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

A new foreign key constraint has been added with ON DELETE CASCADE.

Suggestions:

  1. Ensure repositories.id is indexed for efficient cascade operations.

-- migrate:up

-- Auto-approve is on by default: every org gets an org-level policy with the column defaults.
INSERT INTO auto_approve_policies (org_id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The default organization-level policy has been inserted.

Suggestions:

  1. Consider adding a unique constraint on (org_id, repository_id) to prevent duplicates.

SELECT 1 FROM auto_approve_policies p WHERE p.org_id = o.id AND p.repository_id IS NULL
);

CREATE FUNCTION create_default_auto_approve_policy() RETURNS trigger

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

A function for the default policy has been created.

Suggestions:

  1. Consider naming the function more descriptively, e.g., ensure_default_auto_approve_policy.

LANGUAGE plpgsql
AS $$
BEGIN
INSERT INTO auto_approve_policies (org_id) VALUES (NEW.id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The default policy for new organizations has been inserted.

Suggestions:

  1. Ensure orgs.id is indexed for efficient trigger operation.

Comment thread db/schema.sql
-- Name: create_default_auto_approve_policy(); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.create_default_auto_approve_policy() RETURNS trigger

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

This is the function definition for the default policy.

Suggestions:

  1. Consider adding a comment explaining the purpose of this function.

Comment thread db/schema.sql
-- Name: orgs orgs_default_auto_approve_policy; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER orgs_default_auto_approve_policy AFTER INSERT ON public.orgs FOR EACH ROW EXECUTE FUNCTION public.create_default_auto_approve_policy();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

A trigger has been added to create the default policy for new organizations.

Suggestions:

  1. Consider adding a comment explaining the purpose of this trigger.

Comment thread db/schema.sql

ALTER TABLE ONLY public.auto_approve_policies
ADD CONSTRAINT auto_approve_policies_repository_id_fkey FOREIGN KEY (repository_id) REFERENCES public.repositories(id);
ADD CONSTRAINT auto_approve_policies_repository_id_fkey FOREIGN KEY (repository_id) REFERENCES public.repositories(id) ON DELETE CASCADE;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

This is a foreign key constraint with ON DELETE CASCADE.

Suggestions:

  1. Verify that repositories.id is a primary key or has a unique index.

Comment thread db/schema.sql
('20261012100000'),
('20261013090000');
('20261013090000'),
('20261017090000'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

New migration versions have been added.

Suggestions:

  1. Ensure migration versions are sequential and unique.

return c.JSON(http.StatusInternalServerError, ErrorResponse{Error: err.Error()})
}
s.enrichMetadata(ctx)
if req.FromPRLink {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The inline SQL has been removed and replaced by a helper function.

Suggestions:

  1. Add a comment to markForPolicyCheck explaining the pull_request_id IS NOT NULL condition.

func (s *Server) markForPolicyCheck(reviewID, orgID int64) {
if _, err := s.db.Exec(
`UPDATE reviews SET metadata = COALESCE(metadata, '{}'::jsonb) || '{"pr_link_policy": true}'::jsonb
WHERE id = $1 AND org_id = $2 AND pull_request_id IS NOT NULL`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

A condition has been added to only update reviews that are linked to a pull request.

Suggestions:

  1. Consider logging a warning if pull_request_id is NULL for a review that is being processed.


// Phase 4: Enrich metadata (fetch MR details, update DB)
s.enrichMetadata(ctx)
s.markForPolicyCheck(ctx.review.ID, ctx.orgID)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

A call has been added to mark the review for a policy check.

Suggestions:

  1. Ensure ctx.orgID is always populated before this call.


- Search/filter/sort PRs by provider, repo, state, etc.
- Trigger a review directly for a specific pull request
(`triggerReviewForPullRequest`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The description has been updated to include information about the policy check.

Suggestions:

  1. Consider adding a link to the 'Auto Approve Policies' settings page for more details.

## Purpose

Form to manually trigger a code review (as opposed to it firing from a git
webhook or the `lrc` CLI hook). Lets the user pick a connected AI provider

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The description for manual reviews has been updated.

Suggestions:

  1. Clarify what 'synced' means in the context of PR LiveReview.

- Type a repository name, PR title or author to see matching open PRs. Click
one, or use ↑/↓ and Enter, to start its review.
- Or paste a PR/MR URL and click **Start review**. Either way the new review's
page opens right away, and for a PR LiveReview already synced the org's

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The policy check process for pull request reviews has been clarified.

Suggestions:

  1. Ensure the link to the 'Explore → Merge Requests' page is accurate.

opens the review's detail page.
- **Review history** → the [Reviews list](reviews-list.md) filtered to that
PR (`/reviews?pull_request_id=<id>`).
- A line under the auto-approval decisions (or under the two links before any

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Information regarding policy customization links has been added.

Suggestions:

  1. Ensure the links to repository and organization settings are correct and accessible.

- The decisions table shows the last 10 policy-checked reviews.
- Reviews started any other way (reviewer assignment, @mentions, Explore) don't
run the policy check.
- Reviews started by hand for a known PR also run the policy check and get the

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

It has been clarified which review triggers the policy check.

Suggestions:

  1. Consider adding a note about how to explicitly trigger a policy check for other review types if needed.

legacySectionEnd = "<!-- livereview:end -->"
)

// postLinksComment adds the "Start a review / Review history" links to the end of a new PR/MR's description.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The comment has been updated to reflect the new links.

Suggestions:

  1. Ensure the comment accurately describes all links added by the function.


info, err := loadRepositoryConnectorInfo(w.db, repositoryID)
if err == nil {
err = writePRSection(ctx, info, number, buildPRLinksSection(host, pullRequestID, ""))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The repositoryID has been passed to the buildPRLinksSection function.

Suggestions:

  1. Consider adding a unique constraint on (repository_id, pull_request_id) in the reviews table if not already present.

}

// buildPRLinksSection renders the LiveReview section; history is the review history table, or "".
func buildPRLinksSection(host string, pullRequestID int64, history string) string {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The repositoryID parameter has been added.

Suggestions:

  1. Ensure the repositoryID parameter is always valid and non-zero when passed.

- ▶️ **[Start a review](%s/#/pr/%d/review)**: reviews all changes in this PR against its target branch
- 📜 **[Review history](%s/#/reviews?pull_request_id=%d)**: all past reviews of this PR

%s%s

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Links for policy customization have been added.

Suggestions:

  1. Ensure the URLs for repository and organization settings are correctly formatted and resolve to the intended pages.

}
b.WriteString("\n")
return writePRSection(ctx, info, number, buildPRLinksSection(host, pullRequestID, b.String()))
return writePRSection(ctx, info, number, buildPRLinksSection(host, pullRequestID, info.RepositoryID, b.String()))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The repositoryID has been passed to the buildPRLinksSection function.

Suggestions:

  1. Verify that info.RepositoryID is correctly populated before this call.

// already inserted a row for this org by the time the test ends; its FK
// has no cascade, so it must be cleared first or the org delete leaks.
_, _ = db.Exec(`DELETE FROM dashboard_cache WHERE org_id = $1`, orgID)
_, _ = db.Exec(`DELETE FROM auto_approve_policies WHERE org_id = $1`, orgID)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The default policy for the organization has been deleted.

Suggestions:

  1. Consider using TRUNCATE TABLE auto_approve_policies if it's safe for all tests.


func insertPolicy(t *testing.T, db *sql.DB, orgID int64, repoID *int64, mode string, minLevel int) int64 {
var id int64
if repoID == nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The default organization-level policy has been updated.

Suggestions:

  1. Ensure the repository_id IS NULL condition correctly identifies the default policy.

func TestResolvePolicyNoneConfigured(t *testing.T) {
db := testDB(t)
orgID := seedOrg(t, db, "policy-resolve-none")
// Drop the default row the org-insert trigger created.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The default policy row has been deleted.

Suggestions:

  1. Verify that this deletion does not affect other tests that rely on the default policy.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The button icon has been changed to 'Back'.

Suggestions:

  1. Ensure the Icons.Back component is correctly imported and styled.

}

// buildPRLinksSection renders the LiveReview section; history is the review history table, or "".
func buildPRLinksSection(host string, pullRequestID int64, history string) string {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Add the repositoryID parameter.

Suggestions:

  1. Function signature updated to accommodate new link generation.

- ▶️ **[Start a review](%s/#/pr/%d/review)**: reviews all changes in this PR against its target branch
- 📜 **[Review history](%s/#/reviews?pull_request_id=%d)**: all past reviews of this PR

%s%s

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Add repository and organization policy links.

Suggestions:

  1. This adds valuable links for users to customize their approval policies.

}
b.WriteString("\n")
return writePRSection(ctx, info, number, buildPRLinksSection(host, pullRequestID, b.String()))
return writePRSection(ctx, info, number, buildPRLinksSection(host, pullRequestID, info.RepositoryID, b.String()))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Pass the repositoryID to the buildPRLinksSection function.

Suggestions:

  1. Ensures the function receives all necessary parameters for its updated functionality.

// already inserted a row for this org by the time the test ends; its FK
// has no cascade, so it must be cleared first or the org delete leaks.
_, _ = db.Exec(`DELETE FROM dashboard_cache WHERE org_id = $1`, orgID)
_, _ = db.Exec(`DELETE FROM auto_approve_policies WHERE org_id = $1`, orgID)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Delete the default organization policy row.

Suggestions:

  1. Consider if this explicit deletion is necessary if the trigger logic guarantees a default row.


func insertPolicy(t *testing.T, db *sql.DB, orgID int64, repoID *int64, mode string, minLevel int) int64 {
var id int64
if repoID == nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Update the default organization policy if repoID is null.

Suggestions:

  1. This logic duplicates the INSERT logic but with an UPDATE. Consider a single upsert pattern if possible.

func TestResolvePolicyNoneConfigured(t *testing.T) {
db := testDB(t)
orgID := seedOrg(t, db, "policy-resolve-none")
// Drop the default row the org-insert trigger created.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Delete the default organization policy row.

Suggestions:

  1. Explicitly delete default policy for test isolation.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The icon has been changed from 'Add' to 'Back'.

Suggestions:

  1. Use consistent navigation icons across components.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Apply a negative margin for alignment purposes.

Suggestions:

  1. Ensure consistent spacing and alignment for navigation elements.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The icon has been changed from 'Add' to 'Back'.

Suggestions:

  1. Use consistent navigation icons across components.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Apply a negative margin for alignment purposes.

Suggestions:

  1. Ensure consistent spacing and alignment for navigation elements.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The icon has been changed from 'Add' to 'Back'.

Suggestions:

  1. Use consistent navigation icons across components.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Apply a negative margin for alignment purposes.

Suggestions:

  1. Ensure consistent spacing and alignment for navigation elements.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The icon has been changed from 'Add' to 'Back'.

Suggestions:

  1. Use consistent navigation icons across components.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Apply a negative margin for alignment purposes.

Suggestions:

  1. Ensure consistent spacing and alignment for navigation elements.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The icon has been changed from 'Add' to 'Back'.

Suggestions:

  1. Use consistent navigation icons across components.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Apply a negative margin for alignment purposes.

Suggestions:

  1. Ensure consistent spacing and alignment for navigation elements.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The icon has been changed from 'Add' to 'Back'.

Suggestions:

  1. Use consistent navigation icons across components.

return (
<div className="space-y-4">
<div className="flex items-center">
<Button variant="ghost" icon={<Icons.Add />} onClick={() => navigate('/git')} iconPosition="left" className="text-sm">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Apply a negative margin for alignment purposes.

Suggestions:

  1. Ensure consistent spacing and alignment for navigation elements.

</svg>
),

Back: () => (

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Add a new 'Back' icon component.

Suggestions:

  1. Centralizes common UI elements for consistency.

@@ -1,4 +1,5 @@
import React, { useState, useEffect } from 'react';
import { Icons } from '../../components/UIPrimitives';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Import icons for reusable components.

Suggestions:

  1. Leverages shared UI primitives for consistency.

<div className="flex justify-end">
<Button
variant="ghost"
icon={<Icons.Back />}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Use the reusable 'Back' icon.

Suggestions:

  1. Standardizes navigation elements using shared primitives.

@@ -96,7 +96,6 @@ const MergeRequests: React.FC = () => {
// In-memory only (not persisted) - reverts to "Trigger Review" on a page

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Remove the triggeredReviewIds state.

Suggestions:

  1. Simplifies state management by removing unused state.

const response = await triggerReviewForPullRequest(pr.id);
setTriggeredReviewIds((prev) => ({ ...prev, [pr.id]: response.reviewId }));
notify.success(`Review triggered for #${pr.number}`);
navigate(`/reviews/${response.reviewId}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Navigate directly to the review page.

Suggestions:

  1. Streamlines user flow by redirecting immediately after action.

@@ -316,22 +314,6 @@ const MergeRequests: React.FC = () => {
header: () => <span className="font-semibold text-slate-300 uppercase tracking-wide text-xs">Actions</span>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Remove the logic associated with the 'See Logs' button.

Suggestions:

  1. Removes UI element tied to deprecated state.

},
},
// eslint-disable-next-line react-hooks/exhaustive-deps
], [triggeringId, triggeredReviewIds, navigate]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Remove triggeredReviewIds from the dependency array.

Suggestions:

  1. Ensures effect dependencies are accurate after state removal.

@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { Link, useLocation, useNavigate, useParams } from 'react-router-dom';
import { LuArrowLeft, LuDatabase } from 'react-icons/lu';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Remove the LuArrowLeft import.

Suggestions:

  1. Unused icon import removed.

}, [repoId]);

const back = (
<Link to="/explore/repositories" className="mb-4 inline-flex items-center gap-1.5 text-sm text-slate-300 hover:text-white">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Use a Button component with a Link and the reusable 'Back' icon.

Suggestions:

  1. Standardizes navigation elements using shared primitives.

}, [repoId]);

const back = (
<Link to="/explore/repositories" className="mb-4 inline-flex items-center gap-1.5 text-sm text-slate-300 hover:text-white">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

Apply a negative margin for alignment purposes.

Suggestions:

  1. Ensure consistent spacing and alignment for navigation elements.

<div className="flex items-center mb-6">
<Button
variant="ghost"
icon={<Icons.Dashboard />}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: info

The icon has been changed from 'Dashboard' to 'Back'.

Suggestions:

  1. Use consistent navigation icons across components.

@LinceMathew
LinceMathew merged commit 4e40797 into master Oct 17, 2026
17 of 18 checks 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.

2 participants