@kylincloud/flamegraph 0.35.9 → 0.35.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kylincloud/flamegraph",
3
- "version": "0.35.9",
3
+ "version": "0.35.14",
4
4
  "description": "KylinCloud flamegraph renderer (Pyroscope-based)",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.node.cjs.js",
@@ -51,6 +51,7 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@fortawesome/fontawesome-common-types": "^7.1.0",
54
+ "@release-it/conventional-changelog": "^10.0.2",
54
55
  "@rollup/plugin-commonjs": "^29.0.0",
55
56
  "@rollup/plugin-json": "^6.1.0",
56
57
  "@rollup/plugin-node-resolve": "^16.0.3",
@@ -65,8 +66,10 @@
65
66
  "@types/node": "^24.10.1",
66
67
  "@types/react": "18.2.66",
67
68
  "@types/react-dom": "18.2.22",
69
+ "compare-func": "^2.0.0",
68
70
  "eslint": "^9.0.0",
69
71
  "postcss": "^8.5.6",
72
+ "release-it": "^19.0.6",
70
73
  "rollup": "^4.53.3",
71
74
  "rollup-plugin-postcss": "^4.0.2",
72
75
  "sass": "^1.94.2",
@@ -83,6 +86,7 @@
83
86
  "dev:types": "tsc -p tsconfig.build.json --emitDeclarationOnly --watch",
84
87
  "dev:js": "rollup -c -w",
85
88
  "dev": "pnpm run dev:js",
86
- "lint": "eslint ./ --cache --fix"
89
+ "lint": "eslint ./ --cache --fix",
90
+ "release": "bash -c 'source .env && export GITLAB_TOKEN=\"glpat-$RELEASE_TOKEN\" && release-it'"
87
91
  }
88
92
  }
@@ -500,19 +500,32 @@ const ProfilerTable = React.memo(function ProfilerTable({
500
500
  selectedItem,
501
501
  }: Omit<ProfilerTableProps, 'tableBodyRef'>) {
502
502
  const tableBodyRef = useRef<HTMLTableSectionElement>(null);
503
+ const isDoubles = flamebearer.format === 'double';
503
504
 
504
505
  return (
505
- <div data-testid="table-view">
506
- <Table
507
- tableBodyRef={tableBodyRef}
508
- flamebearer={flamebearer}
509
- isDoubles={flamebearer.format === 'double'}
510
- fitMode={fitMode}
511
- highlightQuery={highlightQuery}
512
- handleTableItemClick={handleTableItemClick}
513
- palette={palette}
514
- selectedItem={selectedItem}
515
- />
506
+ <div
507
+ data-testid="table-view"
508
+ className={
509
+ isDoubles
510
+ ? 'flamegraph-table-wrapper flamegraph-table-wrapper--double'
511
+ : 'flamegraph-table-wrapper'
512
+ }
513
+ >
514
+ {/* 内部滚动容器:只控制表格本身的高度和滚动 */}
515
+ <div className="flamegraph-table-scroll">
516
+ <Table
517
+ tableBodyRef={tableBodyRef}
518
+ flamebearer={flamebearer}
519
+ isDoubles={isDoubles}
520
+ fitMode={fitMode}
521
+ highlightQuery={highlightQuery}
522
+ handleTableItemClick={handleTableItemClick}
523
+ palette={palette}
524
+ selectedItem={selectedItem}
525
+ />
526
+ </div>
527
+
528
+ {/* Tooltip 保持原有行为 */}
516
529
  <TableTooltip
517
530
  tableBodyRef={tableBodyRef}
518
531
  numTicks={flamebearer.numTicks}
@@ -98,7 +98,7 @@ const SharedQueryInput = ({
98
98
  type="search"
99
99
  name="flamegraph-search"
100
100
  placeholder={messages.searchPlaceholder}
101
- minLength={2}
101
+ minLength={1}
102
102
  debounceTimeout={100}
103
103
  onChange={onQueryChange}
104
104
  value={inputValue}
@@ -54,6 +54,10 @@
54
54
  --ps-table-highlight-row-text: #000000;
55
55
  --ps-table-row-text-shadow: #000000;
56
56
 
57
+ // 表头(使用实心背景,避免 sticky 时透出内容)
58
+ --ps-table-header-bg: #212124;
59
+ --ps-table-header-text: #d8d8d8;
60
+
57
61
  // 选择器
58
62
  --ps-selected-app: #df8b53;
59
63
  --ps-select-modal-title: #888888;
@@ -113,7 +117,7 @@
113
117
  // 说明:light 和 kylin 先共享一整套浅色变量,避免回退到 dark
114
118
  // ==========================================================================
115
119
  [data-theme='light'],
116
- [data-theme='kylin'], // ✅ 新增:Box 主题为 kylin 时也用浅色基线
120
+ [data-theme='kylin'], // Box 主题为 kylin 时也用浅色基线
117
121
  [data-flamegraph-color-mode='light'],
118
122
  [data-flamegraph-color-mode='kylin'] {
119
123
  --ps-neutral-1: #ffffff;
@@ -147,6 +151,11 @@
147
151
  --ps-table-highlight-row-bg: #3b78e7;
148
152
  --ps-table-highlight-row-text: #ffffff;
149
153
  --ps-table-row-text-shadow: #ffffff;
154
+
155
+ // 表头默认浅色(浅灰背景 + 深色文字)
156
+ --ps-table-header-bg: #f8f8f8;
157
+ --ps-table-header-text: #272727;
158
+
150
159
  --ps-selected-app: #3b78e7;
151
160
  --ps-select-modal-title: #888888;
152
161
 
@@ -171,7 +180,7 @@
171
180
  // ==========================================================================
172
181
  // Kylin Theme - 在浅色基线上的微调(更贴近 AntD 白色系)
173
182
  // ==========================================================================
174
- [data-theme='kylin'], // ✅ 新增:Box 主题为 kylin 时应用这些微调
183
+ [data-theme='kylin'],
175
184
  [data-flamegraph-color-mode='kylin'] {
176
185
  // 整体背景更接近 AntD
177
186
  --ps-ui-background: #f5f5f5;
@@ -198,4 +207,8 @@
198
207
  --ps-tooltip-bg: #ffffff;
199
208
  --ps-tooltip-text: #000000;
200
209
  --ps-tooltip-header-bg: #f0f0f0;
210
+
211
+ // 表头专用:完全不透明的白色
212
+ --ps-table-header-bg: #ffffff;
213
+ --ps-table-header-text: #000000;
201
214
  }
@@ -16,3 +16,62 @@ pyro-flamegraph {
16
16
  font: 400 16px/1.7 -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica,
17
17
  Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
18
18
  }
19
+
20
+ /* =========================
21
+ * Diff 模式下表格滚动 & 表头固定
22
+ * 仅在 flamebearer.format === 'double' 时生效
23
+ * ========================= */
24
+
25
+ .flamegraph-table-wrapper {
26
+ /* 这里不限制高度,由内部滚动容器控制 */
27
+ position: relative;
28
+ }
29
+
30
+ /* 只在差分火焰图(double)模式下启用滚动限制 */
31
+ .flamegraph-table-wrapper--double .flamegraph-table-scroll {
32
+ /* 最大高度:1000px,可按需调小/调大 */
33
+ max-height: var(--kylin-flamegraph-table-max-height, 1000px);
34
+ overflow-y: auto;
35
+ overflow-x: hidden;
36
+
37
+ /* 让 sticky 参照这个容器 */
38
+ position: relative;
39
+ }
40
+
41
+ /* 表头固定 + 不透明背景,避免内容透出来 */
42
+ .flamegraph-table-wrapper--double .flamegraph-table-scroll thead {
43
+ position: sticky;
44
+ top: 0;
45
+ z-index: 3; // 比下面的行和 tooltip 都高一点
46
+ }
47
+
48
+ /* 整行都有底色,避免列间缝隙透出内容 */
49
+ .flamegraph-table-wrapper--double .flamegraph-table-scroll thead tr {
50
+ background-color: var(--ps-neutral-9);
51
+ }
52
+
53
+ /* 每个单元格再补一层底色,保证完全不透明 */
54
+ .flamegraph-table-wrapper--double .flamegraph-table-scroll thead th {
55
+ background-color: var(--ps-neutral-9);
56
+ background-clip: padding-box; // 防止边框区域产生透明感
57
+ }
58
+
59
+ /* 可选:加一点阴影,视觉上和下面的行分层 */
60
+ .flamegraph-table-wrapper--double .flamegraph-table-scroll thead {
61
+ box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
62
+ }
63
+
64
+
65
+ /* 可选:稍微美化一下内部滚动条,轨道透明,避免太抢眼 */
66
+ .flamegraph-table-wrapper--double .flamegraph-table-scroll::-webkit-scrollbar {
67
+ width: 8px;
68
+ }
69
+
70
+ .flamegraph-table-wrapper--double .flamegraph-table-scroll::-webkit-scrollbar-track {
71
+ background: transparent;
72
+ }
73
+
74
+ .flamegraph-table-wrapper--double .flamegraph-table-scroll::-webkit-scrollbar-thumb {
75
+ background-color: rgba(0, 0, 0, 0.18);
76
+ border-radius: 4px;
77
+ }
@@ -2,6 +2,12 @@
2
2
  width: 100%;
3
3
  table-layout: fixed;
4
4
 
5
+ /* 表头:用专门的实心背景变量,避免透明 */
6
+ thead {
7
+ background-color: var(--ps-table-header-bg, var(--ps-ui-foreground, #ffffff));
8
+ color: var(--ps-table-header-text, var(--ps-ui-foreground-text, #000000));
9
+ }
10
+
5
11
  thead th {
6
12
  &.sortable {
7
13
  cursor: pointer;
@@ -29,7 +35,7 @@
29
35
  }
30
36
  }
31
37
 
32
- thead,
38
+ /* 斑马纹只应用在 tbody 行,不再影响 thead */
33
39
  tbody tr:nth-child(2n) {
34
40
  background-color: var(--ps-neutral-9);
35
41
  }