Skip to content

Glossary Added#370

Merged
Abhishekfm merged 11 commits into
devfrom
feat/glossary
May 15, 2026
Merged

Glossary Added#370
Abhishekfm merged 11 commits into
devfrom
feat/glossary

Conversation

@Abhishekfm
Copy link
Copy Markdown
Collaborator

No description provided.

@Abhishekfm Abhishekfm requested a review from Deepthi-Chand May 4, 2026 08:27
@jpmckinney
Copy link
Copy Markdown
Collaborator

jpmckinney commented May 5, 2026

Looking at potential conflicts (running git merge --no-commit --no-ff feat/glossary from #362):

  • I think we can undo the changes to app/[locale]/[state]/analytics/components/default-output-window.tsx in this PR as they are only linting-related
  • app/[locale]/layout.tsx will conflict, but those changes are easy to merge (add <div className="min-h-screen flex flex-col"> and <main className="flex-1"> wrappers)
  • ✅ The /glossary route is added to config/site.ts

Things to do in reusable branch and other repos:

For the /glossary route and menu item:

  • Make a corresponding change to lib/routes.ts (for the route)
  • Add an entry in locales/en.json (for the link text)
  • Update mainNav in config/site.ts (for the menu)
  • Consider whether a feature flag is needed for the menu item (glossary.csv currently has India-specific content; not sure if we'd want to e.g. create a generic CSV to always load if no deployment-specific CSV is provided)

Comment thread app/[locale]/[state]/analytics/components/default-output-window.tsx
Comment thread config/site.ts Outdated
@jpmckinney
Copy link
Copy Markdown
Collaborator

@Abhishekfm Thanks for the changes. I've squashed your commits. I also for now added the user manual link directly into glossary-header-nav, to avoid the conflict with consts.ts.

If you don't want these changes, we can re-push 7165c83 to restore the previous history.

jpmckinney added a commit to CivicDataLab/ids-drr-branding-types that referenced this pull request May 6, 2026
@jpmckinney
Copy link
Copy Markdown
Collaborator

I updated my above comment with the to-do list for the reusable branch, and pre-emptively made a few changes to that branch, and to https://github.com/open-contracting/ids-drr-branding-types and https://github.com/open-contracting/ids-drr-india-branding, so that once this is merged it'll be easier to integrate.

@Abhishekfm
Copy link
Copy Markdown
Collaborator Author

@jpmckinney Thanks this is a big help. I’m fine keeping the user manual link hardcoded in glossary-header-nav for now. Also, thanks for squashing the commits; I’ll sync my local branch

@jpmckinney
Copy link
Copy Markdown
Collaborator

I've resolved the conflicts and added a commit for the to-do items in my earlier message.

I followed this style guide for message keys: https://github.com/CivicDataLab/IDS-DRR-Frontend/blob/dev/locales/STYLE.md

Abhishekfm and others added 5 commits May 12, 2026 17:26
…analytics components and tailwind config update for node_modules ids-drr-branding
…analytics components and tailwind config update for node_modules ids-drr-branding
…c for branding-stub, and clean up glossary types and functions
@jpmckinney
Copy link
Copy Markdown
Collaborator

@Abhishekfm I'm thinking about how to make the glossary configurable. I think the simplest approach is for the branding packages to read a CSV into a string, which this repo then parses, etc.

I have a draft solution locally, but we'll need to coordinate development since we're touching the same files.

@jpmckinney
Copy link
Copy Markdown
Collaborator

jpmckinney commented May 12, 2026

Also, are you running an old version of data-management?

You changed query indicators($indcFilter: IndicatorFilter, $stateCode: String) { back to Int, but the dev branch of data-management accepts string as of CivicDataLab/IDS-DRR-Data-Management@4d57de5

There are changes that are unrelated to the glossary in these files that relate to that String -> Int change:

  • app/[locale]/[state]/analytics/components/analytics-layout.tsx
  • app/[locale]/[state]/analytics/components/chart-view.tsx
  • app/[locale]/[state]/analytics/components/factor-list.tsx
  • app/[locale]/[state]/analytics/page.tsx
  • config/graphql/analaytics-queries.ts
  • gql/generated/analytics/gql.ts
  • gql/generated/analytics/graphql.ts

Ideally we would keep the PR focused on the glossary and make a separate PR for other changes.

@jpmckinney
Copy link
Copy Markdown
Collaborator

By the way, you added public/robots.txt and public/sitemap*.xml to .gitignore, but those files are no longer generated, as we moved off of next-sitemap in 688b759. You can just delete those files from your local development copy.

@jpmckinney
Copy link
Copy Markdown
Collaborator

jpmckinney commented May 12, 2026

Since we are on very different time zones, to help keep things moving, I'm committing my draft solution to making the glossary configurable, but we can revert it by rewriting history if needed.

If you pull ids-drr-india-branding, you'll get the glossary.csv which is now committed there. (By the way, I can transfer that repo whenever - I just need to know who is doing the transfer so I can give you permission to move it.)

We should still address the issues about the data-management integration in my earlier comment.

This replaces the previous CSV pipeline. Branding packages now ship a
glossaryCsv string, and the frontend reads, parses, and statically
renders it. Future deployments only need a CSV in their branding's
data/: no generator script, no committed generated file.

Refactor scripts/generate-glossary.ts
- Refactor main() into parseGlossary()
- Move parseCsv() to lib/glossary.ts
- Inline toRelatedTerms() into parseGlossary()
- Rename buildDisasterDifferences() to buildDisasterMethodology()

Refactor glossary/index.tsx
- Move slugifyGlossaryTerm() to lib/glossary.ts
- Move glossaryTags computation into uniqueTags() in
  components/glossary/glossary-client.tsx
- Drop the GlossaryIndexItem/GlossaryItem split; the client component
  consumes the full GlossaryTerm[] directly

Other:
- The GlossaryTerm contract moves to ids-drr-branding-types with
  fields mirroring the section headings (summary, definition,
  methodology, usage, significance, interpretation, disasterMethodology,
  related, misinterpretation)
- features.glossary is now derived from glossaryCsv truthiness rather
  than being a separate boolean in the branding config
- Remove the dead "couldn't load details" error UI and its
  glossary.detail.error message key
- Drop ts-node dev dependency and its knip ignoreDependencies entry
  (its only consumer was the deleted generate:glossary script)
- Drop the branding-stub/src/index.ts knip ignore entry; knip can
  trace the file: link without help
@Abhishekfm
Copy link
Copy Markdown
Collaborator Author

Abhishekfm commented May 12, 2026

Thanks @jpmckinney for the updates and for pushing the branding CSV approach on feat/glossary.

  • I synced to your latest branch and checked the glossary locally with India branding (npm install --no-save --force --install-links file:../ids-drr-india-branding). Glossary nav, /glossary, and the main India branding surfaces look good on my side.

  • I reverted the analytics stateCode Int/coercion work in 93b7101 so this PR stays glossary-focused.

@Abhishekfm
Copy link
Copy Markdown
Collaborator Author

Abhishekfm commented May 12, 2026

@jpmckinney For branding repos, Please Grant repo permission to @saurabhlevin or @Deepthi-Chand .

@Abhishekfm Abhishekfm merged commit ce3436e into dev May 15, 2026
1 check passed
@jpmckinney jpmckinney deleted the feat/glossary branch May 15, 2026 15:28
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