Skip to content

feat: add Instance tab for small-team sharing flows #263#294

Open
vipu2404-cyber wants to merge 1 commit into
Abhash-Chakraborty:mainfrom
vipu2404-cyber:feat/instance-sharing-tab
Open

feat: add Instance tab for small-team sharing flows #263#294
vipu2404-cyber wants to merge 1 commit into
Abhash-Chakraborty:mainfrom
vipu2404-cyber:feat/instance-sharing-tab

Conversation

@vipu2404-cyber
Copy link
Copy Markdown

@vipu2404-cyber vipu2404-cyber commented May 30, 2026

Hi @Abhash-Chakraborty,

I have added the frontend UI for the opt-in shared instance management tab as requested in issue #263.

What was done:

  • Created a dedicated instance page route under frontend/src/app/instance/page.tsx.
  • Added a responsive tab system to switch seamlessly between the Join Existing Team Instance form and Setup Admin Instance Flow.
  • Implemented the incoming validation request queue with explicit Approve/Reject state actions.
  • Formatted an active instance directory showing distinct labels for Owner and regular Member assignments.
  • Included the visible, required privacy guardrails warning explaining that single-user operations remain strictly local-first unless manually exposed by an admin.

Please review it! Thanks!

Summary by CodeRabbit

Release Notes

  • New Features
    • Introduced new Shared Instance Administration interface with options to join or create instances
    • Added admin dashboard to manage and review incoming join requests from users
    • Enabled approval and rejection of user requests for instance access
    • Included directory profile management capabilities
    • Added disconnect functionality to reset the administration interface

Review Change Stack

@github-actions github-actions Bot added the needs linked issue Pull request needs to link a valid issue before review. label May 30, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 30, 2026

📝 Walkthrough

Walkthrough

This PR adds a new Next.js page component for shared instance administration. The component implements a multi-view UI with local React state managing join/create instance flows, pending request submission, and an admin dashboard for approving incoming requests and viewing directory profiles.

Changes

Instance Management Page

Layer / File(s) Summary
State model and request handlers
frontend/src/app/instance/page.tsx
AccountViewMode enum defines view states. Component initializes state for current view, active tab, form inputs, pending requests, and directory profiles. handleApproveRequest moves requests to directory; handleRejectRequest removes them.
View switching and initial instance flows
frontend/src/app/instance/page.tsx
Top-level layout conditionally renders error and loading states. The no-instance view provides join/create tabs with distinct forms that set the next view. The request-submitted view shows confirmation messaging and a cancel button.
Admin dashboard and component export
frontend/src/app/instance/page.tsx
Admin dashboard displays pending request queue with inline approve/reject actions, a security directory list with role badges, and a disconnect control. Component exported as default.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

  • #263: Implements the instance page (frontend/src/app/instance/page.tsx) with matching create/join/admin flows and request handling logic.

Suggested labels

frontend, ui/ux, privacy, quality:clean

Suggested reviewers

  • Abhash-Chakraborty

Poem

🐰 A rabbit hops through admin lands,
With join and create in gentle hands,
Requests approved, profiles arranged,
State transitions deftly staged.
bounce bounce 🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description lacks several required template sections including Type of change, What changed (bullet details), Screenshots/recordings, How to test, and most checklist items. Complete the description template by adding the missing sections: specify the type of change, list detailed changes, provide screenshots if applicable, include testing instructions, and check off relevant checklist items.
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 clearly and specifically describes the main feature: adding an Instance tab for small-team sharing flows, and references the related issue #263.
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.

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


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.

@github-actions
Copy link
Copy Markdown

PR Context Summary

  • Linked issue(s): none
  • Referenced but not closing: feat: add Instance tab for small-team sharing flows #263
  • PR author trusted by GitHub: no
  • Dependabot PR: no
  • PR assignee synced from linked issue: no change
  • Macroscope review status: Waiting for under-review or ready-to-merge before triggering Macroscope.

Suggested issue links

Use Fixes #123 or Closes #123 in the PR body when one of the suggestions is the intended issue.
Manual rerun: Actions > PR Context Triage > Run workflow > set pr_number and force_review=true.

Copy link
Copy Markdown
Contributor

@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: 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 `@frontend/src/app/instance/page.tsx`:
- Around line 203-205: The disconnect button's hover color (className on the
button that calls setCurrentView("no-instance-view")) uses hover:text-zinc-200
which becomes low-contrast in light mode; update the className to use
theme-specific hover classes such as hover:text-zinc-700
dark:hover:text-zinc-200 (or equivalent light/dark-friendly tokens) so the label
remains readable in both themes while keeping the existing layout and onClick
behavior.
🪄 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: 0f6a44ac-416c-421f-a0bd-be2b0bd07782

📥 Commits

Reviewing files that changed from the base of the PR and between 44a7d3a and cc657c9.

📒 Files selected for processing (1)
  • frontend/src/app/instance/page.tsx

Comment on lines +203 to +205
<button onClick={() => setCurrentView("no-instance-view")} className="mt-8 text-xs text-zinc-400 hover:text-zinc-200 flex items-center gap-1 transition-colors">
← Disconnect Dashboard Session
</button>
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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix hover text contrast on light mode disconnect control.

hover:text-zinc-200 makes the label very low-contrast on light backgrounds when the control is interacted with. Use theme-specific hover colors so it stays readable in both themes.

Suggested patch
-            <button onClick={() => setCurrentView("no-instance-view")} className="mt-8 text-xs text-zinc-400 hover:text-zinc-200 flex items-center gap-1 transition-colors">
+            <button onClick={() => setCurrentView("no-instance-view")} className="mt-8 text-xs text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 flex items-center gap-1 transition-colors">

As per coding guidelines, "Frontend text must be visible in both dark and light mode when UI is touched".

📝 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
<button onClick={() => setCurrentView("no-instance-view")} className="mt-8 text-xs text-zinc-400 hover:text-zinc-200 flex items-center gap-1 transition-colors">
Disconnect Dashboard Session
</button>
<button onClick={() => setCurrentView("no-instance-view")} className="mt-8 text-xs text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 flex items-center gap-1 transition-colors">
Disconnect Dashboard Session
</button>
🤖 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 `@frontend/src/app/instance/page.tsx` around lines 203 - 205, The disconnect
button's hover color (className on the button that calls
setCurrentView("no-instance-view")) uses hover:text-zinc-200 which becomes
low-contrast in light mode; update the className to use theme-specific hover
classes such as hover:text-zinc-700 dark:hover:text-zinc-200 (or equivalent
light/dark-friendly tokens) so the label remains readable in both themes while
keeping the existing layout and onClick behavior.

)}

{currentView === "error" && (
<div className="p-4 border rounded-xl border-red-200 bg-red-50 text-red-900 dark:border-red-950/20 dark:text-red-200 dark:border-red-900/50 text-sm">
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.

🟡 Medium instance/page.tsx:59

The error state div on line 59 uses dark:border-red-950/20 twice instead of dark:bg-red-950/20 for the background. In dark mode, the error box renders with no background color, making the text unreadable against the dark page background. Change the first dark:border-red-950/20 to dark:bg-red-950/20 to match the warning box pattern on line 42.

-        <div className="p-4 border rounded-xl border-red-200 bg-red-50 text-red-900 dark:border-red-950/20 dark:text-red-200 dark:border-red-900/50 text-sm">
+        <div className="p-4 border rounded-xl border-red-200 bg-red-50 text-red-900 dark:bg-red-950/20 dark:text-red-200 dark:border-red-900/50 text-sm">
🤖 Copy this AI Prompt to have your agent fix this:
In file frontend/src/app/instance/page.tsx around line 59:

The error state div on line 59 uses `dark:border-red-950/20` twice instead of `dark:bg-red-950/20` for the background. In dark mode, the error box renders with no background color, making the text unreadable against the dark page background. Change the first `dark:border-red-950/20` to `dark:bg-red-950/20` to match the warning box pattern on line 42.

Evidence trail:
frontend/src/app/instance/page.tsx line 59 at REVIEWED_COMMIT: dark-mode classes are `dark:border-red-950/20 dark:text-red-200 dark:border-red-900/50` — two `dark:border-*` and no `dark:bg-*`. Compare line 42: `dark:bg-amber-950/20 dark:text-amber-200 dark:border-amber-900/50` — correct pattern with `dark:bg-*`.

@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 30, 2026

Approvability

Verdict: Needs human review

1 blocking correctness issue found. This PR adds a new Instance Management feature page with multiple user-facing workflows (joining instances, creating admin instances, approval dashboard). New feature additions introducing new components and workflows warrant human review regardless of current implementation scope.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs linked issue Pull request needs to link a valid issue before review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant