Skip to content

Text and formatting tweaks across the app - #89

Merged
lewisjared merged 16 commits into
mainfrom
tweaks
Sep 3, 2026
Merged

Text and formatting tweaks across the app#89
lewisjared merged 16 commits into
mainfrom
tweaks

Conversation

@lewisjared

@lewisjared lewisjared commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Works through a list of text and formatting problems found while using the app. Most commits stand alone, so they read best one at a time.

Two changes go beyond formatting and are worth a closer look.

  • SourceDatasetType is a plain enum, so str() on it produced SourceDatasetType.CMIP7. The API now sends the short name. This changes the dataset_type field of every dataset response, so anything matching on the old string breaks. It also fills in the More Info column, because the link was built by testing for cmip6 in a string that never contained it.
  • Shortens the data health warning to one sentence. That copy is shared, so the homepage gets the shorter version too.

The Data Explorer header was picked from three prototypes and then reviewed, so it has had more thought than the diff suggests. The losing variants are on the local prototype/explorer-header branch.

One thing on the original list is not fixed here. The reported full page reload on theme swap could not be reproduced, and nothing in the code reloads on a theme change, though the rewritten useTheme may have changed the behaviour anyway. More Info stays blank for CMIP7 rows, since the backend only knows a lookup URL for CMIP6.

Summary by CodeRabbit

  • New Features
    • Dashboard statistics now show execution-group counts for CMIP6 and CMIP7.
    • Dataset tables display experiment, source, and variable details where applicable.
    • Theme selection now supports light, dark, and system modes.
    • Data Explorer pages have clearer headers, streamlined guidance, and improved controls.
  • Bug Fixes
    • Dataset types now display readable labels and correctly populate More Info links.
    • Theme preferences and system theme detection now work reliably.
  • Improvements
    • Large dashboard counts are formatted for easier reading.
    • Page headers and version information have improved spacing and consistency.
    • Data-health messaging has been clarified.

…P era

- `SourceDatasetType` is a plain enum, so `str()` on it produced `SourceDatasetType.CMIP7`.
  `dataset_type_label` now renders the short name the API is meant to expose.
- Adds `execution_groups_by_mip_era` to the execution statistics, so the dashboard can say
  how much of the ensemble is CMIP7.
The header was a card holding roughly 600px of prose before any content, with dead space
beside the title. It now reads as a band:

- Title, blurb and the catalog and feedback links sit outside any card.
- The what's-available list keeps only the two points the theme tabs and the catalog link
  do not already make.
- Getting started is a compact numbered panel rather than a five step list.
- Shortens the data health warning to one sentence and renders it as a note.
  This copy is shared, so the homepage gets the shorter version too.
Both pages wrapped their title and description in the card that also held the filters and
the table. This matches the diagnostics catalog instead, where the header stands above the
card. The resource usage link moves up to the title row.
Both controls scope the same results, so they belong on the same row. `MipEraScope` takes
an `actions` slot for controls of that kind, and the toggle's state lifts to the route.
Large counts ran together as `954217 scalars`, so every figure in the stat cards is now
locale formatted. The total execution groups card says how the total splits across CMIP6
and CMIP7.
The table showed the slug and the dataset type, so the facets a reader actually scans for
were buried in the slug. Dataset type renders as a badge now that the API sends the short
name.
The toggle only flipped between light and dark, so there was no way back to following the
OS once a pick was stored. `useTheme` now keeps the pick and the resolved theme apart, and
the button names the current mode. Fixes the no-flash script, which resolved a stored
"system" to light.
`Explorer 0.6.2` read as one token.
@netlify

netlify Bot commented Sep 3, 2026

Copy link
Copy Markdown

Deploy Preview for climate-ref ready!

Name Link
🔨 Latest commit 39f2ff8
🔍 Latest deploy log https://app.netlify.com/projects/climate-ref/deploys/6a99147b2283210008a3acc4
😎 Deploy Preview https://deploy-preview-89--climate-ref.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 2eca1588-faee-4871-9181-96b82cae352b

📥 Commits

Reviewing files that changed from the base of the PR and between 4026dba and 39f2ff8.

📒 Files selected for processing (8)
  • backend/src/ref_backend/core/mip_eras.py
  • changelog/89.feature.md
  • changelog/89.fix.md
  • frontend/src/components/dashboard/executionStats.tsx
  • frontend/src/content/data-health-warning.mdx
  • frontend/src/content/introduction-ref-v1.mdx
  • frontend/src/routes/_app/diagnostics.index.tsx
  • frontend/src/routes/_app/explorer/route.tsx
📝 Walkthrough

Walkthrough

The change adds MIP-era execution statistics, short dataset type labels, CMIP-specific dataset columns, three theme modes, shared page headers, and relocated plain-language controls across the dashboard and Data Explorer.

Changes

Data reporting and dataset metadata

Layer / File(s) Summary
Dataset type labels
backend/src/ref_backend/core/mip_eras.py, backend/src/ref_backend/models/datasets.py
Dataset responses now use short source type labels such as cmip7.
Execution statistics contract and query
backend/src/ref_backend/core/mip_eras.py, backend/src/ref_backend/api/routes/executions.py, backend/src/ref_backend/models/executions.py, frontend/src/client/types.gen.ts
Execution statistics now include distinct execution-group counts for each MIP era.
Dashboard counts and dataset columns
frontend/src/components/dashboard/executionStats.tsx, frontend/src/components/datasets/*, frontend/src/lib/format.ts, frontend/src/routes/_app/datasets.index.tsx
The dashboard formats counts and displays CMIP6 and CMIP7 totals. The datasets table adds CMIP metadata columns and source badges.

Theme mode selection

Layer / File(s) Summary
Theme state and system preference
frontend/src/hooks/useTheme.ts
Theme state now supports light, dark, and system modes. System mode follows operating-system preference changes.
Theme control and initialisation
frontend/index.html, frontend/src/components/app/navbar.tsx, changelog/89.feature.md
Initial theme selection validates stored values. The navigation control cycles modes and displays the active mode.

Explorer and page layout

Layer / File(s) Summary
Shared headers and scoped controls
frontend/src/components/app/pageHeader.tsx, frontend/src/components/charts/mipEraBar.tsx, frontend/src/components/app/versionInfo.tsx
A reusable page header supports descriptions and actions. MIP-era controls support scoped actions.
Page header integration
frontend/src/routes/_app/diagnostics.index.tsx, frontend/src/routes/_app/datasets.index.tsx, frontend/src/routes/_app/executions.index.tsx, frontend/src/routes/_app/executions.resources.tsx
Page titles, descriptions, and actions move outside the primary content cards.
Data Explorer content and plain-language state
frontend/src/routes/_app/explorer/*, frontend/src/components/explorer/thematicContent.tsx, frontend/src/content/data-health-warning.mdx, changelog/89.improvement.md
The Explorer uses compact introductory content. The plain-language toggle is controlled by the themes route and rendered on the MIP-era bar.

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant ThemeInit
  participant useTheme
  participant Navbar
  Browser->>ThemeInit: load stored theme mode
  ThemeInit->>Browser: apply initial theme
  Navbar->>useTheme: read mode and cycle
  Navbar->>useTheme: cycle mode
  useTheme->>Browser: persist mode and apply resolved theme
Loading
sequenceDiagram
  participant Dashboard
  participant ExecutionStatsAPI
  participant MIPEraQuery
  participant Database
  Dashboard->>ExecutionStatsAPI: request execution statistics
  ExecutionStatsAPI->>MIPEraQuery: calculate counts by MIP era
  MIPEraQuery->>Database: query execution groups by dataset type
  Database-->>MIPEraQuery: grouped counts
  MIPEraQuery-->>ExecutionStatsAPI: return era counts
  ExecutionStatsAPI-->>Dashboard: render formatted counts
Loading

Merge Risk: 🔵 Low · up to 4026d

The dashboard’s new CMIP-era figures can be misleading because they may include superseded versions and briefly display zero while data loads. Release notes also misdescribe CMIP6-only links and non-exclusive era memberships. These are bounded reporting and documentation issues that should be corrected before release.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 51.52% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 33 functions across 22 files. (5 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and relates to substantial text and formatting changes across the application. It does not identify other major changes, such as layout restructuring, theme cycling, or execution …
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.
Full details: Title check

Explanation

The title is concise and relates to substantial text and formatting changes across the application. It does not identify other major changes, such as layout restructuring, theme cycling, or execution statistics, but it still gives a valid high-level summary.

Full details: Docstring Coverage

Explanation

Docstring coverage is 51.52% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 33 functions across 22 files. (5 skipped: 5 unsupported.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tweaks

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.

The title block was repeated across the diagnostics, datasets, executions and explorer pages.

Also tightens the review's smaller points.

- Names the explorer's feature list for what it holds, and drops the unused `setTheme`.
- Removes a spaced hyphen from a comment, and rewraps the data health warning on clause
  boundaries rather than at a column.
- Moves the resource usage header out of its card, which the other list pages had already left.
- Uses the app's own `SourceTypeBadge` for the dataset type rather than a plain outline badge.
- Shares the theme query the explorer already suspends on, so the plain language toggle no longer
  appears a beat after the bar it sits in.
- Restores the toggle's active styling, which the era selector beside it also has.
- Says in the changelog that this fills in the More Info column, since the link was built from the
  string the enum repr had been leaking into.
Only the CMIP sources carry experiment, source and variable, so obs4mips got three permanently
blank columns. The table now takes the source type it is showing and picks its columns from it.

Also rewords the execution group caption. The two era counts are memberships rather than a
breakdown, because a group with no CMIP input lands in neither and one holding both lands in both.
- Counts the execution groups per era in one grouped query rather than one count per era.
- Builds the dataset table's two column sets once, from named parts, so the reference is stable
  across renders and nothing is reassembled by position.
- Moves the CMIP source test in beside the other source type knowledge.
- Folds the dashboard's local digit grouping into `formatCount`, which used `String`.
  The resource usage page prints grouped digits now too.
- Persists the theme next to the state change rather than in an effect that fired on mount.
- Drops `text-sm` from the shared header's action slot, so it no longer sizes every caller's
  buttons.
@lewisjared
lewisjared marked this pull request as ready for review September 3, 2026 06:01

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 15574510-7c8e-4021-b20e-1b83913aa2b7

📥 Commits

Reviewing files that changed from the base of the PR and between 3a82682 and 4026dba.

📒 Files selected for processing (27)
  • backend/src/ref_backend/api/routes/executions.py
  • backend/src/ref_backend/core/mip_eras.py
  • backend/src/ref_backend/models/datasets.py
  • backend/src/ref_backend/models/executions.py
  • changelog/89.feature.md
  • changelog/89.fix.md
  • changelog/89.improvement.md
  • frontend/index.html
  • frontend/src/client/types.gen.ts
  • frontend/src/components/app/navbar.tsx
  • frontend/src/components/app/pageHeader.tsx
  • frontend/src/components/app/versionInfo.tsx
  • frontend/src/components/charts/mipEraBar.tsx
  • frontend/src/components/dashboard/executionStats.tsx
  • frontend/src/components/datasets/datasetColumns.tsx
  • frontend/src/components/datasets/datasetTable.tsx
  • frontend/src/components/explorer/thematicContent.tsx
  • frontend/src/content/data-health-warning.mdx
  • frontend/src/hooks/useTheme.ts
  • frontend/src/lib/format.ts
  • frontend/src/lib/sourceTypes.ts
  • frontend/src/routes/_app/datasets.index.tsx
  • frontend/src/routes/_app/diagnostics.index.tsx
  • frontend/src/routes/_app/executions.index.tsx
  • frontend/src/routes/_app/executions.resources.tsx
  • frontend/src/routes/_app/explorer/route.tsx
  • frontend/src/routes/_app/explorer/themes.tsx

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread backend/src/ref_backend/api/routes/executions.py
Comment thread changelog/89.feature.md Outdated
Comment thread changelog/89.fix.md Outdated
Comment thread changelog/89.improvement.md
Comment thread frontend/src/components/dashboard/executionStats.tsx Outdated
The diagnostics catalog had vertical padding but no horizontal, and the explorer sat in a full
width block rather than the container, so three pages started their title in three places.
All four now share the container, the padding and the vertical rhythm.
`execution_groups_per_era` counted every diagnostic version, while the total beside it counts only
the promoted version, so the caption could disagree with the number above it.

Also holds the caption at the loading placeholder until the response arrives, rather than showing
zero for both eras, and stops the changelog reading the two counts as a breakdown.
@lewisjared

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Names the diagnostics as the current ones rather than v1, and links them to the Zenodo record.

Also repairs the same link on the introduction page, where `10.5281/zenodo.14284374` had been
mangled into `http://10.0.20.161/zenodo.14284374`, a private address that goes nowhere.
@lewisjared

Copy link
Copy Markdown
Contributor Author

@coderabbitai approve

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@lewisjared
lewisjared merged commit 59b4f83 into main Sep 3, 2026
9 checks passed
@lewisjared
lewisjared deleted the tweaks branch September 3, 2026 07:37
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.

1 participant