Skip to content

Show a Build a dashboard with AI in Horizon button in the dashboards header - #5279

Open
01painadam wants to merge 7 commits into
developfrom
feat/horizon-dashboard-prompt
Open

01painadam wants to merge 7 commits into
developfrom
feat/horizon-dashboard-prompt

Conversation

@01painadam

@01painadam 01painadam commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

Adds a Build a dashboard with AI in Horizon ↗ button to the dashboards header, under the summary text. It opens https://horizon.globalnaturewatch.org/app?prompt=… in a new tab. The prompt asks Horizon to create a dashboard for the area being viewed, with one welcome note that teaches three example prompts, so the person lands in a guided first conversation. This follows the dataset-drawer link from #5276 and is part of the same test of GFW to Horizon redirects.

The button is styled as Horizon's own secondary (lime) button, so it reads as leaving GFW for Horizon rather than as another GFW action.

GFW Dashboard Horizon
Screenshot 2026-10-23 at 10 14 26 Screenshot 2026-10-23 at 10 15 58

Notes

  • Area naming: the prompt names the whole admin chain ("Altamira, Pará, Brazil") so the agent picks the right area. The button stays hidden until every selected level's name has loaded, and while moving to another dashboard, so it never links the area being left.
  • Global dashboard: Horizon has no world-level area, so the prompt first asks which country or region the dashboard should cover.
  • Example prompts are fixed: each was checked on staging to add its widget. Free-form ones promised satellite imagery, which Horizon cannot show for areas over 50,000 km², and notes making claims no analysis had checked.
  • Tracking: utm_source=gfw&utm_medium=dashboards-header&utm_campaign=horizon-dashboard-prompt, plus a GA event (Dashboards page / Open area in Horizon).
  • Colours: the lime values are hard-coded in layouts/dashboards/components/header/styles.scss, each commented with its Horizon token, because GFW has no variables for them.
  • The pre-commit prettier hook also reformatted a few existing closing braces in the header component.

01painadam and others added 7 commits October 21, 2026 16:43
getHorizonDashboardPromptUrl names the area from the most specific admin
level up, so the agent picks the right area, and falls back to asking for
a country on the Global dashboard, since Horizon has no world-level area.
The dataset link now shares the URL builder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The button sits under the area sentence on Global, country, region and
sub-region dashboards, hidden on saved areas and until every selected
admin level's name has loaded. Clicks are tracked under Dashboards page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The store only takes the new location on routeChangeComplete, after the
page's server data loads, so a click in that window sent the previous
area's prompt. Query-only changes (tabs, widget settings) keep the button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A transparent pill with a green border sits below the solid Download and
Forest Atlas buttons and keeps white text readable (white on the solid
green is about 2.2:1). The union.svg icon hard-codes a blue fill that the
sprite's <use> ignores CSS for, so the new sparkle and arrow icons stroke
with currentColor instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The prompt creates the dashboard straight away (7 to 16s on staging) with
one note, without figures, that teaches three example prompts: analyse
tree cover loss and add the chart, add the tree cover loss layer, and add
a note summarising the chart. Each was checked on staging to add its
widget, across eight areas from sub-region to country. The reply then
suggests the first prompt. Free-form examples had promised satellite
imagery, which Horizon cannot show for areas over 50,000 km², and notes
making claims before any analysis.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…once

getHorizonDashboardLink is now a pure function beside the prompt builder,
so the admin-level ordering, the wait for names and the Global case have
tests. The staging-checked first prompt is written once instead of twice,
and a spec assertion that could never fail is gone. The prompt text sent
is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
gfw-staging-pr-5279 — 1afe62b3 Deployed Oct 23, 2026 by willian-viana
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