Repository navigation
Show a Build a dashboard with AI in Horizon button in the dashboards header - #5279
Open
01painadam wants to merge 7 commits into
Open
01painadam wants to merge 7 commits into
01painadam wants to merge 7 commits into
Conversation
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
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.
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.
Notes
utm_source=gfw&utm_medium=dashboards-header&utm_campaign=horizon-dashboard-prompt, plus a GA event (Dashboards page/Open area in Horizon).layouts/dashboards/components/header/styles.scss, each commented with its Horizon token, because GFW has no variables for them.