feat(ui): maintenance banner, PlantSEED dialog fix, disable comments#205
Open
VibhavSetlur wants to merge 3 commits into
Open
feat(ui): maintenance banner, PlantSEED dialog fix, disable comments#205VibhavSetlur wants to merge 3 commits into
VibhavSetlur wants to merge 3 commits into
Conversation
- 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.
There was a problem hiding this comment.
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/maintenanceendpoint (file/env driven) and a globalOutageBannerclient component rendered fromapp/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
ReactionCommentModalrender 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()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Maintenance banner
PlantSEED dialog fix
Comments disabled