diff --git a/e2e/tests/flame-graph-view/github-integration.spec.ts b/e2e/tests/flame-graph-view/github-integration.spec.ts index 46a038a2..c44f676c 100644 --- a/e2e/tests/flame-graph-view/github-integration.spec.ts +++ b/e2e/tests/flame-graph-view/github-integration.spec.ts @@ -18,7 +18,8 @@ test.describe('Flame graph view', () => { const nodePosition = { x: 30, y: 30 }; const functionName = 'github.com/grafana/dskit/services.(*BasicService).main'; const startLine = '153'; - const file = 'github.com/grafana/dskit@v0.0.0-20231221015914-de83901bf4d6/services/basic_service.go'; + // see ellipsis hack in SceneFunctionDetailsPanel.tsx + const fileName = 'ā€ˇgithub.com/grafana/dskit@v0.0.0-20231221015914-de83901bf4d6/services/basic_service.go'; test('When clicking on a flame graph node and then "Function details", it opens a details panel', async ({ exploreProfilesPage, @@ -61,7 +62,7 @@ test.describe('Flame graph view', () => { const filePathRow = detailsPanel.getByTestId('row-file-path'); await expect(filePathRow.getByText('File')).toBeVisible(); - await expect(filePathRow.locator('span')).toHaveText(file); + await expect(filePathRow.locator('span')).toHaveText(fileName); const repositoryRow = detailsPanel.getByTestId('row-repository'); await expect(repositoryRow.getByText('Repository')).toBeVisible(); diff --git a/src/pages/ProfilesExplorerView/components/SceneExploreServiceFlameGraph/components/SceneFunctionDetailsPanel/SceneFunctionDetailsPanel.tsx b/src/pages/ProfilesExplorerView/components/SceneExploreServiceFlameGraph/components/SceneFunctionDetailsPanel/SceneFunctionDetailsPanel.tsx index 7bc81620..0d3ed26c 100644 --- a/src/pages/ProfilesExplorerView/components/SceneExploreServiceFlameGraph/components/SceneFunctionDetailsPanel/SceneFunctionDetailsPanel.tsx +++ b/src/pages/ProfilesExplorerView/components/SceneExploreServiceFlameGraph/components/SceneFunctionDetailsPanel/SceneFunctionDetailsPanel.tsx @@ -171,7 +171,8 @@ export class SceneFunctionDetailsPanel extends SceneObjectBase - {formatFileName(data.functionDetails.fileName)} + {/* adding LRM to prevent ellipsis with RTL to fail when the file name starts with non-alpha chars (e.g. "$") */} + ‎{formatFileName(data.functionDetails.fileName)} ({ } `, textValue: css` + // hack to have the ellipsis appear at the start of the string + direction: rtl; text-overflow: ellipsis; overflow: hidden; - direction: rtl; white-space: nowrap; `, });