Skip to content

BDMS-879: Well detail edit panel and project assignment#300

Merged
jeremyzilar merged 44 commits into
stagingfrom
BDMS-879-project-editing-panel
Jun 23, 2026
Merged

BDMS-879: Well detail edit panel and project assignment#300
jeremyzilar merged 44 commits into
stagingfrom
BDMS-879-project-editing-panel

Conversation

@jeremyzilar

@jeremyzilar jeremyzilar commented Jun 17, 2026

Copy link
Copy Markdown
Contributor
image

Relies on this API change to be out first: DataIntegrationGroup/OcotilloAPI#729

What is changing

  • Add an admin-gated Edit side panel on well detail for assigning and removing project memberships (save-on-change via dropdown)
  • Extract shared editing panel primitives from the Data Grid example and reuse them on well show
  • Add useWellDetails for centralized well detail fetching and cache invalidation after project changes
  • Collapse the nav sidebar when the edit panel opens and restore it on close (useSidebarPanelSync)
  • Sticky edit panel on desktop: main page scrolls while the panel stays pinned on the right; drag the left edge to resize (width persisted in localStorage)
  • Full-width edit panel on mobile (below the app header); main content hidden while editing
  • Combine Preview PDF and Download into a split header button; migrate PDF actions to shadcn
  • Unify list/show page headers via OcotilloPageHeader (Projects, Contacts, Wells)
  • Tweak well header status chips (0.75rem font, tighter padding, vertical alignment with the well ID)
  • Hide Example nav behind SHOW_EXAMPLE_NAV in config/navigation.ts (Data Grid routes remain; set flag to true to restore sidebar link)
  • Fix useIsMobile for CI/tests when window.matchMedia is unavailable

This branch also includes merged work from the projects list/navigation branch (BDMS-876), the Data Grid example page scaffold, and a merge from staging (Tyler’s attachment upload on well detail).

API dependency: Project add/remove calls POST/DELETE /group/{group_id}/things/{thing_id}. Requires OcotilloAPI #729 deployed to staging before those mutations work in preview/staging.

Test plan

  • Open a well detail page as an admin and confirm the Edit button opens the side panel
  • Add and remove projects in the panel; confirm chips update on the detail page without closing the panel (staging API #729 merged)
  • Confirm non-admin users do not see the Edit button
  • Confirm Preview PDF / Download split button works for AMP viewers; Edit appears to the right of PDF actions (admin only)
  • Open edit panel and confirm sidebar collapses; close panel and confirm sidebar restores
  • Open support panel while edit panel is open (both should work independently)
  • On desktop, scroll the well page while the edit panel stays fixed; drag the panel’s left edge to resize and reload to confirm width persists
  • On mobile or a narrow viewport, confirm Edit opens a full-width panel below the header
  • Verify attachment upload still works after the staging merge (AttachmentsCard with thingId)
  • Verify status chips align vertically with the well ID at 12px font size
  • Run npm run test:run -- src/test/pages/well-show.test.tsx

@github-actions

Copy link
Copy Markdown

Preview Deployment

Preview URL: https://preview-bdms-879-project-editing-panel-auejgdbofq-uc.a.run.app

Note: This preview uses the staging API endpoints.

…ews.

Shared header layout for Projects, Contacts, and Wells; edit panel scrolls independently with sticky chrome; project dropdown is shorter and alphabetical; status chips sit tighter when they wrap.
@github-actions

Copy link
Copy Markdown

Preview Deployment

Preview URL: https://preview-bdms-879-project-editing-panel-auejgdbofq-uc.a.run.app

Note: This preview uses the staging API endpoints.

Show optimistic chip changes on add/remove and wait for the details query to refetch before clearing spinners, so the UI does not go idle while the list is still stale.
@github-actions

Copy link
Copy Markdown

Preview Deployment

Preview URL: https://preview-bdms-879-project-editing-panel-auejgdbofq-uc.a.run.app

Note: This preview uses the staging API endpoints.

@github-actions

Copy link
Copy Markdown

Preview Deployment

Preview URL: https://preview-bdms-879-project-editing-panel-auejgdbofq-uc.a.run.app

Note: This preview uses the staging API endpoints.

Project add/remove updates local draft state only; Save applies the diff, refetches well details, and closes the panel. Unsaved close prompts to discard.
@lizalino

Copy link
Copy Markdown

Like the change you implemented, this looks great to me!

Works well, but there seems to be a short delay between when I select a project and when it displays. I think some kind of feedback that the request is in progress might be helpful.

@github-actions

Copy link
Copy Markdown

Preview Deployment

Preview URL: https://preview-bdms-879-project-editing-panel-auejgdbofq-uc.a.run.app

Note: This preview uses the staging API endpoints.

Add the alert-dialog UI component and swap the discard prompt in the well edit panel from Dialog to AlertDialog with a compact max width.
@github-actions

Copy link
Copy Markdown

Preview Deployment

Preview URL: https://preview-bdms-879-project-editing-panel-auejgdbofq-uc.a.run.app

Note: This preview uses the staging API endpoints.

1 similar comment
@github-actions

Copy link
Copy Markdown

Preview Deployment

Preview URL: https://preview-bdms-879-project-editing-panel-auejgdbofq-uc.a.run.app

Note: This preview uses the staging API endpoints.

@jeremyzilar

Copy link
Copy Markdown
Contributor Author

@lizalino There are a few updates:

  • There is now a Save button in the edit panel. This fixes the lag issue when waiting for a save to happen immediately.
  • There is also an alert that pops up in an AlertDialog when you try to close the edit panel before changes have been saved.
image image

@chasetmartin chasetmartin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great! The behavior was as expected in my testing - great confirmation dialog when the user edits but hasn't saved. I just have one minor code comment that should not block merging.


setIsSaving(true)

try {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To be consistent with our other new data mutation requests (the asset upload dialog), should we use Refine's useCustomMutation hook to hit the custom data provider endpoint? I believe the main advantage would be the ability to use the isPending state from the hook to manage some of the saving states that are hand-rolled here (they work just fine in my testing, nicely done)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fix that! Thank you for catching that.

Matches the attachment upload pattern and drives saving state from mutation.isPending instead of hand-rolled isSaving.
@github-actions

Copy link
Copy Markdown

Preview Deployment

Preview URL: https://preview-bdms-879-project-editing-panel-auejgdbofq-uc.a.run.app

Note: This preview uses the staging API endpoints.

@jeremyzilar jeremyzilar merged commit 3a4a20a into staging Jun 23, 2026
4 of 5 checks passed
@jeremyzilar jeremyzilar deleted the BDMS-879-project-editing-panel branch June 23, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants