Skip to content

feat(narratives): PR 2 - print optimization, naming standardizations,…#392

Open
ddebasmita-lab wants to merge 2 commits into
datacommonsorg:mainfrom
ddebasmita-lab:narratives-pr2-fixes
Open

feat(narratives): PR 2 - print optimization, naming standardizations,…#392
ddebasmita-lab wants to merge 2 commits into
datacommonsorg:mainfrom
ddebasmita-lab:narratives-pr2-fixes

Conversation

@ddebasmita-lab

@ddebasmita-lab ddebasmita-lab commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

… and code review fixes

Overview

Clear description of the changes and the problem being solved.

Related Issues

Fixes # (issue number)

Changes Made

  • List significant changes
  • List UI changes (include screenshots if applicable)

Testing Done

Describe the steps you took to test these changes (please also list commands ran if possible).

  • Unit tests passed
  • Integration tests passed
  • Manual verification

Checklist

  • I have followed the style guidelines of this project.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds multi-session chat management with localStorage persistence, integrates official Data Commons web components via a new <DC> wrapper, and updates the Key Metrics dashboard to be config-driven. Key feedback includes resolving case-sensitive import paths for Icons.tsx to prevent compilation failures on Linux, guarding the SSE send function against concurrent streaming invocations, and refactoring the <DC> component to use document.createElement instead of innerHTML to preserve camelCase attributes. Finally, TypeScript's strict mode should be re-enabled in tsconfig.json to maintain type safety.

Comment thread narratives/src/components/drawer_session.tsx Outdated
Comment thread narratives/src/components/sidebar.tsx Outdated
Comment thread narratives/src/components/header.tsx Outdated
Comment thread narratives/src/hooks/use_sse_chat.ts Outdated
Comment thread narratives/src/hooks/use_sse_chat.ts
Comment thread narratives/src/utils/dc_component.tsx Outdated
Comment thread narratives/tsconfig.json
@ddebasmita-lab ddebasmita-lab force-pushed the narratives-pr2-fixes branch from 1930f27 to 1333e87 Compare July 5, 2026 14:58

@juliawu juliawu 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.

Thanks for the new additions! I see a lot of refactoring, especially in making changes compatible with the updates made in the last PR -- great job! I left some comments that should be quick fixes.

Could you also fill out the PR description? It'll be really helpful down the line to have that context.

Comment thread narratives/src/api/dc_observations.ts Outdated
Comment thread narratives/src/index.css Outdated
Comment thread narratives/src/index.css Outdated
Comment thread narratives/src/index.css Outdated
Comment thread narratives/src/utils/print_element.ts Outdated
Comment thread narratives/src/components/tile_chart.tsx Outdated
Comment thread narratives/src/hooks/use_branding.ts Outdated
Comment thread narratives/src/hooks/chat_session_context.tsx Outdated
Comment thread narratives/src/components/drawer_session.tsx Outdated
Comment thread narratives/src/components/data_agent.tsx Outdated
- Fix case-sensitive ./Icons imports (drawer, sidebar, header) so they
  compile on Linux CI.
- Drop redundant empty-message check in useSseChat send (validated upstream).
- Rename DC helper to DataCommonsComponent (+ TagName/Attributes types),
  file to datacommons_component.tsx, and getters to getDcComponentTag /
  getDcComponentAttributes.
- Harden printElement: guard against detached targets and concurrent print
  runs, run cleanup in finally, and dispatch a resize on cleanup so charts
  redraw to the on-screen width.
- Naming/readability: renderWithCitations, source/index, message, session
  (drop one-letter callback params); brandConfigUrl aliased at the boundary.
- Add MS_PER_MINUTE/HOUR/DAY constants in formatRelativeTime.
- Comment fixes: SSR wording, use_branding.ts / print_element.ts references.
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