-
Notifications
You must be signed in to change notification settings - Fork 715
fix: axisvalue issue on go to logs page drilldown #8404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR fixes a drilldown functionality issue by adding a new __axisValue field to drilldown variables when users navigate from dashboard charts to other pages (like logs). The change is implemented in the PanelSchemaRenderer.vue component within two similar code blocks that handle chart drilldown operations.
The modification extracts the axis value from the clicked chart point using drilldownParams?.[0]?.value?.[0] as the primary value, falling back to drilldownParams?.[0]?.name if the value array is empty or undefined. This ensures that when users click on chart data points, the specific axis value (typically representing time or category information) is properly preserved and passed to the target destination.
The fix applies to all chart types except tables and sankey charts, maintaining consistency with the existing drilldown logic while providing the missing context needed for proper data exploration workflows. The implementation uses modern JavaScript optional chaining and nullish coalescing operators to safely handle potentially undefined data structures. Additionally, there's a minor formatting improvement removing extra whitespace in a return statement.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it addresses a clear functional gap without breaking existing behavior
- Score reflects a straightforward fix with proper null safety handling and targeted scope that doesn't affect core functionality
- Pay close attention to the PanelSchemaRenderer.vue file to ensure the axis value extraction logic works correctly with different chart data structures
1 file reviewed, no comments
### **PR Type**
Bug fix
___
### **Description**
- Add `__axisValue` to drilldown payload
- Fallback to name when value missing
- Improve logs page drilldown accuracy
___
### Diagram Walkthrough
```mermaid
flowchart LR
A["Drilldown event params"] --> B["Extract value/name"]
B --> C["Set __axisValue from value[0]"]
B --> D["Fallback to name if missing"]
C --> E["Build drilldown payload"]
D --> E
```
<details> <summary><h3> File Walkthrough</h3></summary>
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>PanelSchemaRenderer.vue</strong><dd><code>Add robust
axis value to drilldown data</code>
</dd></summary>
<hr>
web/src/components/dashboards/PanelSchemaRenderer.vue
<ul><li>Add <code>__axisValue</code> to the drilldown data object.<br>
<li> Use first element of <code>value</code> array when available.<br>
<li> Fallback to <code>name</code> when <code>value[0]</code> is
absent.</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8405/files#diff-e5376e7e77bf3aaf6590c2522d8c2dbffcc95a8006ae0d6dc0040a37825367d6">+3/-0</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___
No description provided.