Skip to content

feat(WellLogViewer): add optional formatWellPickLabel callback for we… - #2816

Open
hkfb wants to merge 3 commits into
equinor:masterfrom
hkfb:add-wellpick-label-formatter
Open

feat(WellLogViewer): add optional formatWellPickLabel callback for we…#2816
hkfb wants to merge 3 commits into
equinor:masterfrom
hkfb:add-wellpick-label-formatter

Conversation

@hkfb

@hkfb hkfb commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

…ll-pick label formatting

Adds an opt-in formatWellPickLabel(markerName, depth) callback to WellPickProps that lets consumers customize well-pick marker depth label formatting (e.g. show 2 decimal places instead of the default whole-unit rounding via toFixed(0)). When the callback is not provided, the existing default behaviour is preserved exactly, so no other consumer of the shared component is affected.

Related to internal tracking ticket EP Connect #554887.

…ll-pick label formatting

Adds an opt-in formatWellPickLabel(markerName, depth) callback to
WellPickProps that lets consumers customize well-pick marker depth
label formatting (e.g. show 2 decimal places instead of the default
whole-unit rounding via toFixed(0)). When the callback is not
provided, the existing default behaviour is preserved exactly,
so no other consumer of the shared component is affected.

Related to internal tracking ticket EP Connect #554887.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hkfb hkfb added AspenTech Task owned by AspenTech well-log-viewer labels Aug 14, 2026
hkfb and others added 2 commits August 14, 2026 08:53
…m formatWellPickLabel

Reworks the formatWellPickLabel callback after plan review. It is now
invoked once per well pick with an object argument
{ horizon, vPrimary, vSecondary } and returns a partial
{ primary, secondary, horizon } object, so a consumer can control all
three rendered label cells and, crucially, distinguish the primary from
the secondary depth - which the previous (markerName, depth) => string
signature made impossible.

- add WellPickLabels and WellPickLabelInput types
- add defaultWellPickLabels() and resolveWellPickLabels() helpers,
  exported from the package so consumers can compose with the defaults
- remove the previous formatWellPickDepthLabel() helper
- render labels.horizon in the marker name cell; element names, color
  and pattern lookups keep using the raw horizon
- rewrite the unit tests and add render-level tests for the three cells
- update the Storybook story to the new callback shape

Default rendering is byte-for-byte unchanged when the prop is not set.

Related to internal tracking ticket EP Connect #554887.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…eslint

The formatWellPickLabel mock in WellLogView.test.tsx declared an unused
_input parameter, which failed the typescript CI check with
@typescript-eslint/no-unused-vars. The mock now returns the horizon from
its input so the parameter is used.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

Pull request overview

This PR adds an opt-in label-formatting hook for well-pick overlays in WellLogView, allowing consumers to customize how primary/secondary depths and horizon text are displayed while preserving the existing default formatting when no callback is provided.

Changes:

  • Introduces formatWellPickLabel (with WellPickLabelInput/WellPickLabels) and label-resolution helpers (defaultWellPickLabels, resolveWellPickLabels) used by the overlay rendering path.
  • Adds Storybook coverage demonstrating custom label formatting.
  • Adds unit/integration-style tests covering default behavior, callback behavior, and rendered output.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
typescript/packages/well-log-viewer/src/WellLogViewer.stories.tsx Adds a Storybook story demonstrating custom well-pick label formatting via the new callback.
typescript/packages/well-log-viewer/src/components/WellLogView.tsx Adds new callback/type definitions and routes overlay label rendering through default/override resolution helpers.
typescript/packages/well-log-viewer/src/components/WellLogView.test.tsx Adds tests for default/override label behavior and verifies rendered labels in the DOM.
typescript/packages/well-log-viewer/src/components/index.ts Re-exports new helpers and types from the components package entrypoint.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +356 to +360
* Optional callback to override the default well-pick label formatting.
*
* It is called exactly once per well pick and receives the horizon name
* together with the full-precision primary and secondary depth values
* (either of which may be `undefined` or non-finite).
Comment on lines 684 to 688
"<span " +
styleText +
">" +
horizon +
labels.horizon +
"</span>" +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AspenTech Task owned by AspenTech well-log-viewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants