Skip to content

feat(ui): maintenance banner, PlantSEED dialog fix, disable comments#205

Open
VibhavSetlur wants to merge 3 commits into
ModelSEED:stagingfrom
VibhavSetlur:staging
Open

feat(ui): maintenance banner, PlantSEED dialog fix, disable comments#205
VibhavSetlur wants to merge 3 commits into
ModelSEED:stagingfrom
VibhavSetlur:staging

Conversation

@VibhavSetlur
Copy link
Copy Markdown
Collaborator

Summary

Maintenance banner

  • Added /api/maintenance endpoint — checks /tmp/maintenance.json (runtime toggle, no restart) or MAINTENANCE_MODE env var
  • OutageBanner component renders yellow warning banner on every page

PlantSEED dialog fix

  • Added proper title, version info, and maintenance explanation to the PlantSEED tab dialog (was rendering empty)

Comments disabled

  • Comment button column, Notes column, and ReactionCommentModal disabled on biochem reactions table — code stays commented out for easy re-enable

- GET /api/maintenance checks /tmp/maintenance.json first (runtime toggle,
  no restart needed), then falls back to MAINTENANCE_MODE env var
- OutageBanner component renders a yellow warning banner at the top of
  every page when maintenance mode is enabled
- Sam can toggle by: echo '{enabled:true,message:...}' > /tmp/maintenance.json
The PlantSEED tab dialog was rendering empty (just a Close button).
Added title, version info, and explanation that annotation/reconstruction
services are temporarily offline for updates.
Comment button column, Notes column, and ReactionCommentModal are
commented out with a /* disabled */ comment. The code stays in the
file for easy re-enabling.
Copilot AI review requested due to automatic review settings May 19, 2026 19:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a runtime-configurable maintenance mode indicator to the UI, fixes the previously-empty PlantSEED maintenance dialog content, and disables reaction comments UI elements in the biochem reactions table.

Changes:

  • Added /api/maintenance endpoint (file/env driven) and a global OutageBanner client component rendered from app/layout.tsx.
  • Updated the PlantSEED dialog to show a proper title, version transition info, and a maintenance message.
  • Disabled reaction comments UI (comment action column, notes column, comment modal) on the biochem reactions grid.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
components/ui/OutageBanner.tsx New client banner that fetches /api/maintenance and conditionally displays a warning alert site-wide.
app/layout.tsx Renders OutageBanner globally in the root layout.
app/api/maintenance/route.ts New maintenance status endpoint reading /tmp/maintenance.json or env vars.
app/(reference-data)/biochem/reactions/page.tsx Disables comments-related grid column(s) and modal rendering.
app/(build-model)/plant/page.tsx Replaces empty PlantSEED dialog body with explanatory maintenance content.
Comments suppressed due to low confidence (1)

app/(reference-data)/biochem/reactions/page.tsx:448

  • The ReactionCommentModal render is commented out, but the related state (commentModalOpen, commentReactionId) is still declared. Those state variables become unused and will fail eslint; either comment out/remove the associated state/handlers too, or gate the whole comments feature behind a flag so the code stays compile-clean.
            {/* <ReactionCommentModal
                open={commentModalOpen}
                onClose={() => setCommentModalOpen(false)}
                reactionId={commentReactionId}
            /> */}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -18,7 +18,7 @@ import { getReactions, type Reaction, type SolrQueryOpts, EXTERNAL_DBS } from '@
import ChemicalEquation from '@/components/ui/ChemicalEquation';
import IconButton from '@mui/material/IconButton';
import ChatBubbleOutlineIcon from '@mui/icons-material/ChatBubbleOutline';
Comment on lines 458 to +480
<Dialog
open={plantseedDialogOpen}
onClose={() => setPlantseedDialogOpen(false)}
maxWidth="sm"
fullWidth
>
<DialogActions>
<Button onClick={() => setPlantseedDialogOpen(false)}>
Close
</Button>
</DialogActions>
<Box sx={{ p: 3 }}>
<Typography variant="h6" fontWeight={600} gutterBottom>
PlantSEED — Update In Progress
</Typography>
<Typography variant="body2" sx={{ color: 'text.secondary', mb: 2 }}>
PlantSEED v2.0 → PlantSEED v3.0
</Typography>
<Alert severity="info" sx={{ mb: 2 }}>
Annotation and reconstruction services are temporarily offline for updates
and will be restored shortly.
</Alert>
<Box sx={{ display: 'flex', justifyContent: 'flex-end' }}>
<Button onClick={() => setPlantseedDialogOpen(false)} variant="contained">
Close
</Button>
</Box>
</Box>
Comment on lines 458 to +470
<Dialog
open={plantseedDialogOpen}
onClose={() => setPlantseedDialogOpen(false)}
maxWidth="sm"
fullWidth
>
<DialogActions>
<Button onClick={() => setPlantseedDialogOpen(false)}>
Close
</Button>
</DialogActions>
<Box sx={{ p: 3 }}>
<Typography variant="h6" fontWeight={600} gutterBottom>
PlantSEED — Update In Progress
</Typography>
<Typography variant="body2" sx={{ color: 'text.secondary', mb: 2 }}>
PlantSEED v2.0 → PlantSEED v3.0
</Typography>
Comment on lines +34 to +52
export async function GET(): Promise<NextResponse> {
// 1. Check file-based toggle first (runtime toggle, no restart needed)
const fileStatus = readFileStatus();
if (fileStatus) {
return NextResponse.json(fileStatus);
}

// 2. Fall back to env var (requires container restart)
const envEnabled = process.env.MAINTENANCE_MODE === 'true' || process.env.MAINTENANCE_MODE === '1';
if (envEnabled) {
return NextResponse.json({
enabled: true,
message: process.env.MAINTENANCE_MESSAGE || 'Site is undergoing maintenance. Please check back shortly.',
});
}

// 3. Default: not in maintenance
return NextResponse.json({ enabled: false, message: '' });
}
Comment on lines +1 to +9
/**
* Maintenance mode status endpoint.
*
* Returns whether the site is in maintenance mode and an optional message.
* Sam can toggle this by:
* 1. Setting MAINTENANCE_MODE env var (requires container restart)
* 2. Creating /tmp/maintenance.json with {"enabled":true,"message":"..."}
* (file is checked at runtime, no restart needed)
*/
Comment on lines +17 to +18
fetch('/api/maintenance')
.then((res) => res.json())
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