feat(WellLogViewer): add optional formatWellPickLabel callback for we… - #2816
Open
hkfb wants to merge 3 commits into
Open
feat(WellLogViewer): add optional formatWellPickLabel callback for we…#2816hkfb wants to merge 3 commits into
hkfb wants to merge 3 commits into
Conversation
…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>
…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>
There was a problem hiding this comment.
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(withWellPickLabelInput/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>" + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…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.