File size: 3,790 Bytes
95131e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d8e2332
95131e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d8e2332
95131e1
d8e2332
95131e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d8e2332
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/**
 *
 * Copyright 2023-present InspectorRAGet Team
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 **/

@use '@carbon/react/scss/spacing' as *;

$line-color: var(--cds-border-interactive);
$line-width: 1px;

// Horizontal gap from spine to card left edge.
$spine-to-card: $spacing-06;

// Vertical midpoint of a trace card header (padding $spacing-03 top + ~1rem text).
$header-mid: $spacing-06;

// --- Spine ---

.spine {
  position: relative;
  padding-left: $spine-to-card;

  // Solid vertical line from midpoint of first card to midpoint of last.
  &::before {
    content: '';
    position: absolute;
    left: 0;
    top: $header-mid;
    bottom: $header-mid;
    width: $line-width;
    background-color: $line-color;
  }

  // Dotted tail below the last card — signals the trace ends here.
  &::after {
    content: '';
    position: absolute;
    left: 0;
    top: calc(100% - $header-mid);
    height: $spacing-07;
    width: $line-width;
    background-image: repeating-linear-gradient(
      to bottom,
      $line-color 0,
      $line-color 3px,
      transparent 3px,
      transparent 7px
    );
  }
}

// --- Root nodes ---

.rootNode {
  position: relative;
  margin-bottom: $spacing-03;

  // Solid horizontal tick from spine to card.
  &::before {
    content: '';
    position: absolute;
    left: calc(-1 * $spine-to-card);
    top: calc($header-mid - $line-width / 2);
    width: $spine-to-card;
    height: $line-width;
    background-color: $line-color;
  }
}

.rootNodeLast {
  margin-bottom: 0;
}

// --- Children (sub-agent trace indentation) ---

// Indented wrapper for child trace events.
.children {
  margin-left: $spacing-05;
  margin-top: $spacing-02;
}

// Each child draws its own L-shaped connector:
//   - vertical segment: from the top of the card down to header midpoint
//   - horizontal segment: from the spine to the card's left edge
// For non-last children the vertical segment continues full height.
// border-bottom-left-radius gives the smooth elbow corner.
.childNode {
  position: relative;
  margin-left: $spacing-05;
  margin-bottom: $spacing-02;

  &::before {
    content: '';
    position: absolute;
    left: calc(-1 * $spacing-05);

    // Vertical segment runs from top of card to header midpoint.
    top: 0;
    height: calc($header-mid + $line-width / 2);
    width: $spacing-05;

    // L-shape: left border = vertical run, bottom border = horizontal run.
    border-left: $line-width solid $line-color;
    border-bottom: $line-width solid $line-color;
    border-bottom-left-radius: 3px;
  }

  // Non-last children: extend the vertical segment the full card height so the
  // trunk continues unbroken to the next sibling.
  &:not(.childNodeLast)::before {
    height: 100%;
  }
}

.childNodeLast {
  margin-bottom: 0;
}

// --- Collapsed depth node ---

// Shown instead of rendering children automatically when depth >= 3.
.collapsedNode {
  margin-left: $spacing-05;
  margin-top: $spacing-02;
  padding: $spacing-02 $spacing-03;
  background: none;
  border: 1px dashed var(--cds-border-subtle-01);
  border-radius: 2px;
  font-size: 0.75rem;
  color: var(--cds-text-secondary);
  cursor: pointer;
  text-align: left;
  width: 100%;

  &:hover {
    background-color: var(--cds-layer-hover-01);
  }
}