Skip to content

2035-validate-filters-form-load-sr#2062

Open
githelsui wants to merge 13 commits intohackforla:mainfrom
githelsui:2035-validate-filters-form-load-sr
Open

2035-validate-filters-form-load-sr#2062
githelsui wants to merge 13 commits intohackforla:mainfrom
githelsui:2035-validate-filters-form-load-sr

Conversation

@githelsui
Copy link
Copy Markdown
Member

@githelsui githelsui commented Nov 19, 2025

Fixes Issue #2035 (DEV - validate filters form and load SR data on form submit)

Status

  • Implemented form validation logic, UI, and data flow, for all inputs (Address, Council, Date, Request Types, Request Status)
  • Implemented all Dev ToDo Items from Issue #2035
  • Most Up To Date Change on recent comments in Issue #2035

Implemented Changes
Screenshot 2025-11-19 at 2 45 54 PM

Action Items

  • Up to date with main branch
  • Branch name follows guidelines
  • All PR Status checks are successful
  • Peer reviewed and approved

Copy link
Copy Markdown

@RoanBox RoanBox left a comment

Choose a reason for hiding this comment

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

Leaving REQUEST_CHANGES based on needed fixes to the blank-map data-loading flow, address/council interaction behavior, and the Export enablement logic in this PR.

this.processSearchParams();
await this.createRequestsTable();
await this.setData();
// Blank Map Implementation: createRequestTable and setData now called via Redux
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This changes the initial load flow, but there are still app paths assuming the DuckDB table exists on startup. Running this locally, the app throws from LastUpdated.jsx with Table with name requests_2025 does not exist! before any Display Data action. The delayed-load flow needs to be made consistent across startup consumers before this is ready to merge.

geoFilterType={geoFilterType}
councils={councils}
onGeocoderResult={onGeocoderResult}
onGeocoderResult={handleGeocoderResult}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

FilterMenu now intercepts the geocoder result here, but it no longer forwards that result to the existing parent callback from Map.jsx. That appears to bypass the current address-search behavior (reset/zoom/council selection) rather than just delaying data fetch until submit.

dispatchUpdateSelectedCouncils(newSelected);
dispatchUpdateUnselectedCouncils(councils);
dispatchUpdateNcId(selectedCouncilId);
// dispatchUpdateNcId(selectedCouncilId); // Triggers zoom
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These calls are commented out, so selecting a council no longer updates ncId or closes the boundaries picker. Since map zoom behavior changes are explicitly out of scope for this issue, this looks like an unrelated behavior regression.

<div className={`${classes.selectorWrapper} ${classes.export}`}>
<ExportButton />
<div className={classes.selectorWrapper}>
<ExportButton className={classes.export} disabled={formValid === false}/>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This enables Export based on local form validity, not on whether data has actually been fetched and loaded successfully. The issue requirement says Export should remain disabled until data is successfully fetched and loaded.

@RoanBox
Copy link
Copy Markdown

RoanBox commented Apr 16, 2026

This branch conflicts with main in src/features/Map/index.jsx, but the real issue is not the conflict itself. The conflict is a symptom of two different data-loading contracts: current main still assumes the existing startup/refresh flow in Map/index.jsx, while this PR is trying to convert that component to a submit-driven Blank Map flow using an older copy of the file. I’d recommend resolving the conflict by starting from the current main version of Map/index.jsx, then re-applying only the intended Blank Map submit-flow changes on top of that newer base.

Merge conflict context and recommended resolution

I walked the merge locally to see what kind of conflict this actually is. The good news is that the merge only produces a direct content conflict in one file, src/features/Map/index.jsx.

The important part is that this is not a simple “pick ours vs. pick theirs” conflict. main and this PR are carrying different assumptions about how Map/index.jsx is supposed to load and refresh request data.

1. What changed on main

On the main side, src/features/Map/index.jsx has been updated recently to support the current year-specific data-loading flow. In the current origin/main version, the component imports DATA_SOURCE plus getServiceRequestHF / getServiceRequestSocrata, creates the request table during componentDidMount(), and refreshes data during componentDidUpdate() when mode/date/council inputs change.

Two recent PRs matter here. PR #2075 (“Fix unit tests and parameterize dataset year”) removed the fallback-to-prior-year behavior and simplified createRequestsTable() so it loads the selected year directly instead of mutating dates on fallback. The review discussion on that PR explicitly says the newer Blank Map designs made the fallback behavior unnecessary. PR #2081 then patched the same file to set isTableLoading back to false once the request table is created, so the loading modal would not hang indefinitely.

2. What your PR is trying to do

On this PR’s side, src/features/Map/index.jsx is modifying an older version of the file to implement the submit-driven Blank Map behavior from issue #2035.

Specifically, it comments out the startup calls to createRequestsTable() and setData() in componentDidMount(), comments out the existing automatic refresh path in componentDidUpdate(), and replaces that path with a shouldDisplayData flag that only runs the load after the new Display Data action is triggered.

That is a legitimate direction for this ticket, but it is being layered onto a stale copy of Map/index.jsx, so the merge conflict is really between “current main’s data-loading contract” and “this PR’s submit-only data-loading contract.”

3. What changed and why it conflicted

There is also longer-running feature context here. The Blank Map/request-table direction traces back to PR #1952 (“One request table v2 1891”), which fixed issue #1891. That issue and its comments make it clear that one of the goals was a Blank Map flow where the app can initialize without loading request data on startup. The approval comment on #1952 even calls out that the map loads immediately because no data is requested on start.

So conceptually, this PR is moving in a direction that has precedent in the project. The problem is that main has continued evolving Map/index.jsx since then, especially through #2075 and #2081, and this branch is no longer merging cleanly against that current shape.

Recommended resolution

Because of that, I would recommend resolving the conflict by starting from the current main version of src/features/Map/index.jsx, not from this PR’s version. Then re-apply only the intended Blank Map submit-driven changes on top of that newer base.

In practice, that means preserving the current main imports, DATA_SOURCE handling, and the current createRequestsTable() shape, while selectively re-introducing the submit-trigger mechanism from this PR. I would also preserve the #2081 loading-modal fix, and update any startup consumers that still assume request tables exist on page load.

That last point matters because I tested this locally and hit a real startup failure after following this PR’s flow: LastUpdated.jsx still queries DuckDB on startup and throws Table with name requests_2025 does not exist! before any Display Data action has been taken. So the merge conflict is only one file, but the correct resolution is not just about making Git happy. It also needs to reconcile the broader load contract across the app.

After the conflict is resolved, I’d re-test initial page load, LastUpdated / other startup DuckDB consumers, address search, council selection, the Display Data submit flow, and Export enablement after a successful fetch/load before asking for another review pass.

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