Skip to content

Conversation

EdenWuyifan
Copy link
Collaborator

@EdenWuyifan EdenWuyifan commented Aug 31, 2025

@roquelopez Here are the new designs made for value matching annotations.

This pull request introduces several improvements and minor fixes across the backend and frontend codebases. The most significant changes include updates to ontology resource paths to use a new JSON file, UI enhancements for better usability and clarity, and minor code cleanups. Below are the most important changes grouped by theme:

Ontology Resource Path Updates

  • Changed references to ontology resource files from gdc_ontology_flat.json to gdc_ontology.json in api/index.py, api/utils.py, and removed redundant path definitions from api/tools/task_tools.py. This ensures consistency and uses the updated ontology data. [1] [2] [3]

Frontend UI Enhancements

  • Added a close button to the file upload dialog in fileuploading.tsx for improved user experience.
  • Enhanced enum value display in RelevantKnowledgeView.tsx by adding tooltips with definitions and highlighting search matches, improving clarity and interactivity. [1] [2] [3]
  • Replaced unused MUI components (Chip, CircularProgress) with Tooltip for cleaner imports.
  • Added import for CloseIcon to support the new close button functionality.

Backend Minor Fixes and Cleanups

  • Reformatted logging and dictionary assignment code for readability and maintainability in memory.py and matching_task.py. [1] [2]
  • Improved docstrings and error logging formatting for task tools in task_tools.py. [1] [2]

Build Script Cleanup

  • Removed unused Redis kill scripts from package.json to simplify development and start scripts. [1] [2]

@Copilot Copilot AI review requested due to automatic review settings August 31, 2025 19:59
logger.info(
f"🧰Tool called: search_explanations with query='{query}', "
f"limit={limit}"
f"🧰Tool called: search_explanations with query='{query}', " f"limit={limit}"

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
f"🧰Tool called: search_explanations with query='{query}', " f"limit={limit}"
f"🧰Tool called: search_explanations with query='{query}', "
f"limit={limit}"

Comment on lines +1356 to +1359
self.cached_candidates[
"matchers"
] = self.weight_updater.update_matchers(
self.cached_candidates["matchers"]

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
self.cached_candidates[
"matchers"
] = self.weight_updater.update_matchers(
self.cached_candidates["matchers"]
self.cached_candidates["matchers"] = (
self.weight_updater.update_matchers(
self.cached_candidates["matchers"]
)

Copy link

Coverage report

St.
Category Percentage Covered / Total
🔴 Statements 58.18% 7408/12733
🟡 Branches 60.7% 485/799
🔴 Functions 40.4% 122/302
🔴 Lines 58.18% 7408/12733

Test suite run success

3 tests passing in 3 suites.

Report generated by 🧪jest coverage report action from 4b7c585

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements an enhanced value matching system with a new custom table interface for value comparisons. The changes replace the MaterialReactTable component with a custom implementation that provides better interaction features and enum support.

  • Replaces MaterialReactTable with custom table implementation for better control and performance
  • Adds enum popup functionality with search and tooltips for GDC attributes
  • Enhances value editing capabilities with inline editing and filtering options

Reviewed Changes

Copilot reviewed 10 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
package.json Removes Redis kill scripts for development workflow
app/lib/heatmap/heatmap-helper.tsx Adds enumDef property to GDCAttribute interface
app/dashboard/components/value-comparisons/value-comparison-table.tsx Complete rewrite from MaterialReactTable to custom table with enum support
app/dashboard/components/fileuploading.tsx Adds close button to file upload dialog
app/dashboard/components/explanation/RelevantKnowledgeView.tsx Adds tooltips for enum values using enumDef
api/utils.py Updates GDC ontology file path
api/tools/task_tools.py Code formatting improvements and cleanup
api/matching_task.py Code formatting improvements
api/langchain/memory.py Code formatting improvements
api/index.py Updates GDC ontology file path

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -1,12 +1,12 @@
import { useMemo, useContext, useEffect } from "react";
import { useMemo, useContext, useEffect, useState, useCallback, useRef, useLayoutEffect } from "react";
Copy link

Copilot AI Aug 31, 2025

Choose a reason for hiding this comment

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

[nitpick] The import statement is too long and imports many hooks. Consider grouping related imports or splitting into multiple lines for better readability.

Suggested change
import { useMemo, useContext, useEffect, useState, useCallback, useRef, useLayoutEffect } from "react";
import {
useMemo,
useContext,
useEffect,
useState,
useCallback,
useRef,
useLayoutEffect
} from "react";

Copilot uses AI. Check for mistakes.


// Build dynamic column keys in display order
const dynamicColumnKeys = useMemo(() => {
if (!rows.length) return [] as string[];
Copy link

Copilot AI Aug 31, 2025

Choose a reason for hiding this comment

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

Potential runtime error if rows[0] is undefined. The condition !rows.length is checked above, but there's a race condition where rows could be empty between the check and this line.

Copilot uses AI. Check for mistakes.

}, [candidate]);

const displayedColumnKeys = useMemo(() => {
if (!rows.length) return [] as string[];
Copy link

Copilot AI Aug 31, 2025

Choose a reason for hiding this comment

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

Same potential runtime error as above - accessing rows[0] without ensuring rows is not empty could cause a crash.

Copilot uses AI. Check for mistakes.

max-width: 300px !important;
}
.table-container { overflow: auto; border: 1px solid rgba(0,0,0,0.12); border-radius: 8px; width: 100%; }
table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; table-layout: fixed; font-size: 0.92rem; }
Copy link

Copilot AI Aug 31, 2025

Choose a reason for hiding this comment

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

[nitpick] Inline CSS styles should be moved to a separate CSS file or styled components for better maintainability and reusability.

Copilot uses AI. Check for mistakes.

Comment on lines +450 to +451
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
transformOrigin={{ vertical: 'bottom', horizontal: 'center' }}
Copy link

Copilot AI Aug 31, 2025

Choose a reason for hiding this comment

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

[nitpick] String literals should use consistent quote style. The component uses double quotes elsewhere but single quotes here.

Suggested change
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
transformOrigin={{ vertical: 'bottom', horizontal: 'center' }}
transformOrigin={{ vertical: "bottom", horizontal: "center" }}

Copilot uses AI. Check for mistakes.

Copy link

Coverage

Coverage Report
FileStmtsMissCoverMissing
api
   index.py57724558%38–39, 106, 114–118, 123–179, 184–240, 249–287, 305–310, 323–328, 378, 411, 430–456, 471, 492–505, 520, 536, 542, 554, 569–585, 600–606, 618–631, 643–654, 666–679, 692–705, 749, 758–768, 775–803, 832, 842, 848, 866, 903–906, 921, 938–941, 1020–1052, 1074, 1081–1083, 1088–1102, 1117–1127, 1137
   matching_task.py66024363%83–85, 113–159, 167–224, 280, 313, 334–336, 395, 399–414, 426, 437–500, 534, 667, 710, 750, 814–825, 866, 886–899, 904–957, 961–963, 977–1015, 1025, 1028–1035, 1069, 1084–1093, 1101–1116, 1119, 1122, 1126, 1133, 1142, 1158–1161, 1185–1201, 1229, 1240, 1267–1273, 1281, 1287, 1340, 1375–1384, 1431, 1444, 1473, 1481–1483, 1500, 1503–1507, 1510
   session_manager.py501178%25–26, 30–31, 39, 47–50, 53, 56
   utils.py31512162%33, 47, 58–60, 63–65, 88–89, 102–119, 123–124, 128–129, 161–162, 187–189, 206, 209–218, 225–232, 242, 271, 281–296, 300–302, 314–354, 360–366, 407–409, 419–421, 425–427, 435–439, 447–450, 516–520, 536–540
api/candidate_quadrants
   candidate_quadrants.py902276%130, 136–152, 156–162, 165–168, 172
api/clusterer
   column_encoder.py431370%51, 55, 83, 92, 101–102, 111, 115, 125–126, 135–136, 144
   embedding_clusterer.py741974%59–76, 83, 102–110
   utils.py1299923%14–16, 20–22, 27–29, 34–35, 40–46, 50–60, 64–66, 125, 129, 140–172, 177–190, 207–208, 236–307
api/langchain
   agent.py1964577%85, 99–104, 106–109, 273, 281, 284–287, 296, 378–381, 400–403, 430–461, 466–475, 506–511
   memory.py2848072%147–173, 295, 304, 312–313, 378, 380, 382, 545, 565–566, 585, 664–675, 678–689, 692–706, 709–723, 726–739, 767–768, 816–817, 825–826
   rag.py38380%1–69
api/langgraph
   langgraph.py2012010%2–778
api/matcher
   bdikit.py41295%52, 113
   difflib.py23291%34, 48
   magneto.py25196%28
   rapidfuzz_value.py93990%49, 99, 106, 126, 148–151, 164–166
   utils.py10280%26, 49
   valentine.py40295%68, 79
api/tools
   candidate_tools.py651577%114–116, 136–138, 184–186, 227–229, 270–272
   online_research_tools.py1816763%31, 61, 76, 85–87, 116–132, 143–159, 170–186, 197–213, 241, 247, 257, 285–287, 302, 330–332, 351, 390–392, 411, 421, 455–457, 461–484
   query_tools.py781581%132, 160–167, 189–196, 218–219
   source_scraper.py10190%40
   task_tools.py521473%21, 50–54, 82, 96–101, 117–123
TOTAL3425126763% 

Tests Skipped Failures Errors Time
60 0 💤 1 ❌ 0 🔥 1m 55s ⏱️

@EdenWuyifan EdenWuyifan merged commit eb0e7b2 into main Aug 31, 2025
6 checks passed
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