中文版本: components.zh.md
All components live under src/renderer/src/components/.
File: TitleBar.tsx
Props: { onRunCommand: (commandId: AppCommandId) => void, onOpenSettingsSection: (section: SettingsSection) => void, updateState: UpdateState | null }
macOS-style custom title bar with three zones on the same horizontal line:
- Traffic-lights reserve (92 px) — leaves room for the native red / yellow / green controls created by
titleBarStyle: 'hiddenInset' - Left command cluster — icon-only
Toggle Sidebarbutton plus a single RadixDropdownMenutrigger that replaces the oldFile / View / Helptext menus - Center filename — current file basename or fallback app title
- Right status cluster — updater pill / dot and backend
Live/Offlineindicator
Top-level order is fixed:
New WindowFileViewWindowSettingsHelpQuit
Submenus:
- File — Open File, Open Workspace, Close File, Save Image, Save Archive
- View — Profile, Freq × Phase, Time × Phase, Bandpass, PSRCAT
- Window — Toggle Sidebar, Minimize Window, Toggle Full Screen
- Help — Keyboard Shortcuts, Check for Updates, About
The custom menu and the native macOS menu bar both dispatch into the same shared command ids from src/shared/commands.ts.
checking— small neutral pillChecking…available— compact green dot that expands toUpdateon hoverdownloading— progress pillDownloading 37%downloaded—Restart to Update
File: Sidebar.tsx
Props: { onOpenFile: () => void, onOpenFolder?: () => void }
Two-column layout:
| Icon | Action |
|---|---|
| FolderOpen | Opens Files navigator panel |
| Globe | Opens full-screen PSRCAT panel (psrcatOpenAtom = true) |
| HelpCircle | Opens HelpPanel |
| Settings | Opens SettingsPanel |
Active section: 3 px accent bar on the left edge of the icon button.
Contains FilesNavigator with:
Open-file icon, open-folder icon, refresh icon (spins while loading).
When a workspace is set, renders a recursive TreeNode component:
- Directory nodes: chevron expand/collapse, folder icon, children rendered at increasing indent (12 px per depth level)
- File nodes: file icon, monospace filename, label color dots, open-but-not-active indicator dot
- Empty directories are not rendered
- Click a file node to activate it (adds to
openFilesAtom, setscurrentFileAtom)
Without workspace: falls back to flat open-files list.
Click any label in the Labels section to filter the tree to only show files tagged with that label. An active filter shows a dismissal chip at the top.
- Shows all user labels with colored dots, file count badge, delete button
- + button opens an inline name input to create a new label (color auto-assigned from palette)
- Click a label to filter the file tree by that label
Source, telescope, centre frequency, bandwidth, channels, sub-integrations, period, DM for the active archive.
- Open / Close
- Copy Path
- Reveal in Finder
- Label toggle list (checkmark for applied labels)
File: PsrcatPanel.tsx
Full-screen overlay panel (fixed inset-0, z-150) containing the PSRCAT P–Ṗ diagram. Opened via globe icon in sidebar or ⌘5. Press Escape or click ✕ to close.
File: MainPanel.tsx
Root content area. Shows empty state (Radio icon) when no file is loaded.
PSRCAT removed from main tabs — it is now a full-screen panel opened from the sidebar globe icon.
Profile | Freq × Phase | Time × Phase | Bandpass
Active tab: accent bottom-border + subtle background.
| Icon | Layout | Description |
|---|---|---|
| □ | single |
One chart, full area |
| ⫴ | horizontal |
Two columns, side by side |
| ☰ | vertical |
Two rows, stacked |
| ⊞ | grid |
2×2 grid of four panes |
In multi-pane layouts each pane has its own SlotHeader — click the pane title to get a dropdown to pick which of the 4 chart types that pane renders. Slots persist in splitSlotsAtom (default: profile/waterfall/time-phase/bandpass).
- Absolute loading spinner overlay (
loadingAtom) - Absolute error overlay (
errorAtom) - Each pane renders a
ChartRendererwith the assignedViewTab - Top-right
Processingbutton toggles the right-sideProcessingInspector WaterfallChartnow receives the shared processing recipe updater so zapping goes through the same session history as the inspector controls
File: ProcessingInspector.tsx
Right-side processing workspace for the session-based PSRCHIVE workflow.
- Fixed-width sidebar attached to the chart area
- Hidden until
processingInspectorOpenAtom = true - Header includes close button and runtime summary
- If advanced processing is unavailable, the panel stays open and renders capability notes from
/api/capabilities
- Zap
- Shows zapped channel count
- Lists
recipe.zap.channels - Supports clearing all zapped channels
- Pam
- Debounced controls for
dedisperse,tscrunch,fscrunch,bscrunch,phase rotate
- Debounced controls for
- TOA
- Template picker
patalgorithm and output format selection- Optional scrunch flags and text export path
- Renders parsed TOA rows and an observed/template/difference residual chart
- Cal
- Search path /
database.txt/ solution file inputs - Model selector (
SingleAxis,Polar,Reception) pol-onlytoggle- Shows latest
pacpreview command/log
- Search path /
- Batch
- Output naming defaults
- Saved workspace-scoped recipe management
- Sequential batch runner
- Preview-affecting edits call the same recipe updater used by undo/redo.
toaandoutputconfig remain part of the live recipe so they can be saved into batch recipes.- Batch runs create temporary sessions per file, export processed archives, optionally export TOA text, then destroy each session.
File: StatusBar.tsx
28 px bar at the bottom of the screen.
Left side: backend status dot + Loading... when loadingAtom is true.
Right side (when a file is loaded): source name, telescope, NchxNsubxNbin, file path.
File: SettingsPanel.tsx
Exported: SettingsPanel, applyTheme
Centered settings center (not a right drawer anymore), opened via settingsOpenAtom.
The panel keeps the draft-save model for persisted preferences:
settingsAtom— committed preferences in local storagedraftSettingsAtom— working copy while the modal is open- Save commits the draft
- Cancel discards it
settingsSectionAtom chooses the active left-nav category and is intentionally not persisted.
- Left column — category navigation and updater summary
- Right column — active category detail area plus a shared Save / Cancel footer
- App
- Language
- Show Welcome
- Update Status / Current Version / Update Channel
Check for Updates- Disabled placeholders:
Desktop notifications,Keep screen awake,HTTP proxy
- Appearance
- Theme cards
- Chart Colorscale swatches
- Workspace
- Current workspace path
Open Workspace/Change Workspace- Default View
- Recent Files Limit
- Backend
- Backend status
Restart Backend- Backend Port
- Python Path
- Shortcuts
- Read-only grouped view generated from the
SHORTCUTSconstant
- Read-only grouped view generated from the
- About
- App version
- Release channel
- Update phase
Open Help- external documentation link
- Immediate:
Check for Updates,Open Workspace,Restart Backend - Saved on footer: language, welcome screen, theme, colorscale, default view, recent file limit, backend port, python path
Theme changes are still applied through applyTheme(theme) when the draft is committed.
File: HelpPanel.tsx
Exported: HelpPanel, HelpButton
Modal dialog (max-w-3xl, 85 vh), closed by overlay click or Escape.
Three sub-tabs:
| Tab | Content |
|---|---|
| View Guide | Per-chart scientific meaning + Plotly interactions (zoom/pan/hover/reset) for Profile, Freq×Phase, Time×Phase, Bandpass; Split View tip |
| Shortcuts | All shortcuts from SHORTCUTS constant, grouped by category, with <kbd> chips |
| UI Guide | Icon-by-icon explanation of sidebar rail, PSRCAT panel, Labels, Split View, Settings, Plotly controls |
Language follows settings.language (EN / ZH) for all content.
HelpButton is a standalone icon button that sets helpOpenAtom = true.
All charts live in components/charts/.
File: charts/PlotlyWrapper.tsx
Props: { data: Plotly.Data[], layout?: Partial<Plotly.Layout>, config?: Partial<Plotly.Config>, onPlotlyClick?: ..., onPlotlySelected?: ... }
Manages a raw plotly.js-dist-min <div>, handling:
- Mount:
Plotly.newPlot()+ResizeObserver→Plotly.Plots.resize() - Update:
Plotly.react()on data/layout changes - Unmount:
Plotly.purge()+ disconnect observer
Merges a shared DARK_LAYOUT (transparent background, #0f1420 plot area, monospace font, muted grid) with per-chart overrides.
The wrapper now optionally forwards Plotly click/select events so chart components can drive non-destructive processing actions.
File: charts/ProfileChart.tsx
Line chart showing intensity (Stokes I) and optional stokes_q, stokes_u, stokes_v vs phase.
X-axis: Phase (0–1), Y-axis: Intensity (normalized).
File: charts/WaterfallChart.tsx
Heatmap of shape [nchan][nbin] — frequency channels (MHz) on Y, phase on X.
Colorscale driven by settings.chartColorscale.
Used to inspect dispersion and RFI.
Additional v1 processing behavior:
- enables Plotly box-select mode in the modebar
- clicking a row toggles a single zapped channel
- box-select adds a channel range to
recipe.zap.channels - all zapping still flows through the same session recipe updater used by the Processing Inspector
File: charts/TimePhaseChart.tsx
Heatmap of shape [nsubint][nbin] — sub-integration index on Y, phase on X.
Used to inspect pulse jitter, scintillation, and dropout events.
File: charts/BandpassChart.tsx
Line chart of mean intensity per frequency channel.
X-axis: Frequency (MHz), Y-axis: Mean Intensity.
Useful for identifying bad channels and bandpass shape.
File: charts/PsrcatView.tsx
Full-page P–Ṗ diagram (scatter GL) with:
- Points color-coded by class: Normal (blue), MSP (green), Binary (cyan), Magnetar (red)
- Constant-parameter lines: B-field (dashed), characteristic age τ (dotted), spin-down luminosity Ė (solid)
- Annotations at line endpoints
- Search box — exact name match highlights the pulsar with a white star marker
- Stats bar — total count + per-class pills
Fetches data once on mount from /api/psrcat/pulsars and /api/psrcat/stats.