| b69ab31 | | | 1 | /** |
| b69ab31 | | | 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| b69ab31 | | | 3 | * |
| b69ab31 | | | 4 | * This source code is licensed under the MIT license found in the |
| b69ab31 | | | 5 | * LICENSE file in the root directory of this source tree. |
| b69ab31 | | | 6 | */ |
| b69ab31 | | | 7 | |
| b69ab31 | | | 8 | import type {DragHandler} from '../../DragHandle'; |
| b69ab31 | | | 9 | import type {CommitRev, CommitState} from '../commitStackState'; |
| b69ab31 | | | 10 | import type {StackEditOpDescription, UseStackEditState} from './stackEditState'; |
| b69ab31 | | | 11 | |
| b69ab31 | | | 12 | import {is} from 'immutable'; |
| b69ab31 | | | 13 | import {Button} from 'isl-components/Button'; |
| b69ab31 | | | 14 | import {Icon} from 'isl-components/Icon'; |
| b69ab31 | | | 15 | import {Tooltip} from 'isl-components/Tooltip'; |
| b69ab31 | | | 16 | import {useRef, useState} from 'react'; |
| b69ab31 | | | 17 | import {nullthrows} from 'shared/utils'; |
| b69ab31 | | | 18 | import {AnimatedReorderGroup} from '../../AnimatedReorderGroup'; |
| b69ab31 | | | 19 | import {CommitTitle as StandaloneCommitTitle} from '../../CommitTitle'; |
| b69ab31 | | | 20 | import {Row} from '../../ComponentUtils'; |
| b69ab31 | | | 21 | import {DragHandle} from '../../DragHandle'; |
| b69ab31 | | | 22 | import {DraggingOverlay} from '../../DraggingOverlay'; |
| b69ab31 | | | 23 | import {t, T} from '../../i18n'; |
| b69ab31 | | | 24 | import {SplitCommitIcon} from '../../icons/SplitCommitIcon'; |
| b69ab31 | | | 25 | import {reorderedRevs} from '../commitStackState'; |
| b69ab31 | | | 26 | import {ReorderState} from '../reorderState'; |
| b69ab31 | | | 27 | import {bumpStackEditMetric, useStackEditState, WDIR_NODE} from './stackEditState'; |
| b69ab31 | | | 28 | |
| b69ab31 | | | 29 | import './StackEditSubTree.css'; |
| b69ab31 | | | 30 | |
| b69ab31 | | | 31 | type ActivateSplitProps = { |
| b69ab31 | | | 32 | activateSplitTab?: () => void; |
| b69ab31 | | | 33 | }; |
| b69ab31 | | | 34 | |
| b69ab31 | | | 35 | // <StackEditSubTree /> assumes stack is loaded. |
| b69ab31 | | | 36 | export function StackEditSubTree(props: ActivateSplitProps): React.ReactElement { |
| b69ab31 | | | 37 | const stackEdit = useStackEditState(); |
| b69ab31 | | | 38 | const [reorderState, setReorderState] = useState<ReorderState>(() => new ReorderState()); |
| b69ab31 | | | 39 | |
| b69ab31 | | | 40 | const onDragRef = useRef<DragHandler | null>(null); |
| b69ab31 | | | 41 | const commitListDivRef = useRef<HTMLDivElement | null>(null); |
| b69ab31 | | | 42 | |
| b69ab31 | | | 43 | const commitStack = stackEdit.commitStack; |
| b69ab31 | | | 44 | const revs = reorderState.isDragging() |
| b69ab31 | | | 45 | ? reorderState.reorderRevs.slice(1).toArray().reverse() |
| b69ab31 | | | 46 | : commitStack.mutableRevs().reverse(); |
| b69ab31 | | | 47 | |
| b69ab31 | | | 48 | // What will happen after drop. |
| b69ab31 | | | 49 | const draggingHintText: string | null = |
| b69ab31 | | | 50 | reorderState.draggingRevs.size > 1 ? t('Dependent commits are moved together') : null; |
| b69ab31 | | | 51 | |
| b69ab31 | | | 52 | const getDragHandler = (rev: CommitRev): DragHandler => { |
| b69ab31 | | | 53 | // Track `reorderState` updates in case the <DragHandle/>-captured `reorderState` gets outdated. |
| b69ab31 | | | 54 | // Note: this would be unnecessary if React provides `getState()` instead of `state`. |
| b69ab31 | | | 55 | let currentReorderState = reorderState; |
| b69ab31 | | | 56 | const setCurrentReorderState = (state: ReorderState) => { |
| b69ab31 | | | 57 | if (is(state, currentReorderState)) { |
| b69ab31 | | | 58 | return; |
| b69ab31 | | | 59 | } |
| b69ab31 | | | 60 | currentReorderState = state; |
| b69ab31 | | | 61 | setReorderState(state); |
| b69ab31 | | | 62 | }; |
| b69ab31 | | | 63 | |
| b69ab31 | | | 64 | return (x, y, isDragging) => { |
| b69ab31 | | | 65 | // Visual update. |
| b69ab31 | | | 66 | onDragRef.current?.(x, y, isDragging); |
| b69ab31 | | | 67 | // State update. |
| b69ab31 | | | 68 | if (isDragging) { |
| b69ab31 | | | 69 | if (currentReorderState.isDragging()) { |
| b69ab31 | | | 70 | if (commitListDivRef.current) { |
| b69ab31 | | | 71 | const offset = calculateReorderOffset( |
| b69ab31 | | | 72 | commitListDivRef.current, |
| b69ab31 | | | 73 | y, |
| b69ab31 | | | 74 | currentReorderState.draggingRev, |
| b69ab31 | | | 75 | ); |
| b69ab31 | | | 76 | const newReorderState = currentReorderState.withOffset(offset); |
| b69ab31 | | | 77 | setCurrentReorderState(newReorderState); |
| b69ab31 | | | 78 | } |
| b69ab31 | | | 79 | } else { |
| b69ab31 | | | 80 | setCurrentReorderState(ReorderState.init(commitStack, rev)); |
| b69ab31 | | | 81 | } |
| b69ab31 | | | 82 | } else if (!isDragging && currentReorderState.isDragging()) { |
| b69ab31 | | | 83 | // Apply reorder. |
| b69ab31 | | | 84 | const order = currentReorderState.reorderRevs.toArray(); |
| b69ab31 | | | 85 | const commitStack = stackEdit.commitStack; |
| b69ab31 | | | 86 | if (commitStack.canReorder(order) && !currentReorderState.isNoop()) { |
| b69ab31 | | | 87 | const newStackState = commitStack.reorder(order); |
| b69ab31 | | | 88 | stackEdit.push(newStackState, { |
| b69ab31 | | | 89 | name: 'move', |
| b69ab31 | | | 90 | offset: currentReorderState.offset, |
| b69ab31 | | | 91 | depCount: currentReorderState.draggingRevs.size - 1, |
| b69ab31 | | | 92 | commit: nullthrows(commitStack.stack.get(currentReorderState.draggingRev)), |
| b69ab31 | | | 93 | }); |
| b69ab31 | | | 94 | bumpStackEditMetric('moveDnD'); |
| b69ab31 | | | 95 | } |
| b69ab31 | | | 96 | // Reset reorder state. |
| b69ab31 | | | 97 | setCurrentReorderState(new ReorderState()); |
| b69ab31 | | | 98 | } |
| b69ab31 | | | 99 | }; |
| b69ab31 | | | 100 | }; |
| b69ab31 | | | 101 | |
| b69ab31 | | | 102 | return ( |
| b69ab31 | | | 103 | <> |
| b69ab31 | | | 104 | <div className="stack-edit-subtree" ref={commitListDivRef}> |
| b69ab31 | | | 105 | <AnimatedReorderGroup> |
| b69ab31 | | | 106 | {revs.map(rev => { |
| b69ab31 | | | 107 | return ( |
| b69ab31 | | | 108 | <StackEditCommit |
| b69ab31 | | | 109 | key={rev} |
| b69ab31 | | | 110 | rev={rev} |
| b69ab31 | | | 111 | stackEdit={stackEdit} |
| b69ab31 | | | 112 | isReorderPreview={reorderState.draggingRevs.includes(rev)} |
| b69ab31 | | | 113 | onDrag={getDragHandler(rev)} |
| b69ab31 | | | 114 | activateSplitTab={props.activateSplitTab} |
| b69ab31 | | | 115 | /> |
| b69ab31 | | | 116 | ); |
| b69ab31 | | | 117 | })} |
| b69ab31 | | | 118 | </AnimatedReorderGroup> |
| b69ab31 | | | 119 | </div> |
| b69ab31 | | | 120 | {reorderState.isDragging() && ( |
| b69ab31 | | | 121 | <DraggingOverlay onDragRef={onDragRef} hint={draggingHintText}> |
| b69ab31 | | | 122 | {reorderState.draggingRevs |
| b69ab31 | | | 123 | .toArray() |
| b69ab31 | | | 124 | .reverse() |
| b69ab31 | | | 125 | .map(rev => ( |
| b69ab31 | | | 126 | <StackEditCommit key={rev} rev={rev} stackEdit={stackEdit} /> |
| b69ab31 | | | 127 | ))} |
| b69ab31 | | | 128 | </DraggingOverlay> |
| b69ab31 | | | 129 | )} |
| b69ab31 | | | 130 | </> |
| b69ab31 | | | 131 | ); |
| b69ab31 | | | 132 | } |
| b69ab31 | | | 133 | |
| b69ab31 | | | 134 | export function StackEditCommit({ |
| b69ab31 | | | 135 | rev, |
| b69ab31 | | | 136 | stackEdit, |
| b69ab31 | | | 137 | onDrag, |
| b69ab31 | | | 138 | isReorderPreview, |
| b69ab31 | | | 139 | activateSplitTab, |
| b69ab31 | | | 140 | }: { |
| b69ab31 | | | 141 | rev: CommitRev; |
| b69ab31 | | | 142 | stackEdit: UseStackEditState; |
| b69ab31 | | | 143 | onDrag?: DragHandler; |
| b69ab31 | | | 144 | isReorderPreview?: boolean; |
| b69ab31 | | | 145 | } & ActivateSplitProps): React.ReactElement { |
| b69ab31 | | | 146 | const state = stackEdit.commitStack; |
| b69ab31 | | | 147 | const canFold = state.canFoldDown(rev); |
| b69ab31 | | | 148 | const canDrop = state.canDrop(rev); |
| b69ab31 | | | 149 | const canMoveDown = state.canMoveDown(rev); |
| b69ab31 | | | 150 | const canMoveUp = state.canMoveUp(rev); |
| b69ab31 | | | 151 | const commit = nullthrows(state.stack.get(rev)); |
| b69ab31 | | | 152 | const titleText = commit.text.split('\n', 1).at(0) ?? ''; |
| b69ab31 | | | 153 | |
| b69ab31 | | | 154 | const handleMoveUp = () => { |
| b69ab31 | | | 155 | stackEdit.push(state.reorder(reorderedRevs(state, rev)), {name: 'move', offset: 1, commit}); |
| b69ab31 | | | 156 | bumpStackEditMetric('moveUpDown'); |
| b69ab31 | | | 157 | }; |
| b69ab31 | | | 158 | const handleMoveDown = () => { |
| b69ab31 | | | 159 | stackEdit.push(state.reorder(reorderedRevs(state, rev - 1)), { |
| b69ab31 | | | 160 | name: 'move', |
| b69ab31 | | | 161 | offset: -1, |
| b69ab31 | | | 162 | commit, |
| b69ab31 | | | 163 | }); |
| b69ab31 | | | 164 | bumpStackEditMetric('moveUpDown'); |
| b69ab31 | | | 165 | }; |
| b69ab31 | | | 166 | const handleFoldDown = () => { |
| b69ab31 | | | 167 | stackEdit.push(state.foldDown(rev), {name: 'fold', commit}); |
| b69ab31 | | | 168 | bumpStackEditMetric('fold'); |
| b69ab31 | | | 169 | }; |
| b69ab31 | | | 170 | const handleDrop = () => { |
| b69ab31 | | | 171 | stackEdit.push(state.drop(rev), {name: 'drop', commit}); |
| b69ab31 | | | 172 | bumpStackEditMetric('drop'); |
| b69ab31 | | | 173 | }; |
| b69ab31 | | | 174 | const handleSplit = () => { |
| b69ab31 | | | 175 | stackEdit.setSplitRange(commit.key); |
| b69ab31 | | | 176 | // Focus the split panel. |
| b69ab31 | | | 177 | activateSplitTab?.(); |
| b69ab31 | | | 178 | }; |
| b69ab31 | | | 179 | |
| b69ab31 | | | 180 | const title = |
| b69ab31 | | | 181 | titleText === '' ? ( |
| b69ab31 | | | 182 | <span className="commit-title untitled"> |
| b69ab31 | | | 183 | <T>Untitled</T> |
| b69ab31 | | | 184 | </span> |
| b69ab31 | | | 185 | ) : ( |
| b69ab31 | | | 186 | <StandaloneCommitTitle commitMessage={commit.text} /> |
| b69ab31 | | | 187 | ); |
| b69ab31 | | | 188 | const buttons = ( |
| b69ab31 | | | 189 | <div className="stack-edit-button-group"> |
| b69ab31 | | | 190 | <Tooltip |
| b69ab31 | | | 191 | title={ |
| b69ab31 | | | 192 | canMoveUp |
| b69ab31 | | | 193 | ? t('Move commit up in the stack') |
| b69ab31 | | | 194 | : t( |
| b69ab31 | | | 195 | 'Cannot move up if this commit is at the top, or if the next commit depends on this commit', |
| b69ab31 | | | 196 | ) |
| b69ab31 | | | 197 | }> |
| b69ab31 | | | 198 | <Button disabled={!canMoveUp} onClick={handleMoveUp} icon> |
| b69ab31 | | | 199 | <Icon icon="chevron-up" /> |
| b69ab31 | | | 200 | </Button> |
| b69ab31 | | | 201 | </Tooltip> |
| b69ab31 | | | 202 | <Tooltip |
| b69ab31 | | | 203 | title={ |
| b69ab31 | | | 204 | canMoveDown |
| b69ab31 | | | 205 | ? t('Move commit down in the stack') |
| b69ab31 | | | 206 | : t( |
| b69ab31 | | | 207 | 'Cannot move up if this commit is at the bottom, or if this commit depends on its parent', |
| b69ab31 | | | 208 | ) |
| b69ab31 | | | 209 | }> |
| b69ab31 | | | 210 | <Button disabled={!canMoveDown} onClick={handleMoveDown} icon> |
| b69ab31 | | | 211 | <Icon icon="chevron-down" /> |
| b69ab31 | | | 212 | </Button> |
| b69ab31 | | | 213 | </Tooltip> |
| b69ab31 | | | 214 | <Tooltip |
| b69ab31 | | | 215 | title={ |
| b69ab31 | | | 216 | canFold |
| b69ab31 | | | 217 | ? t('Fold the commit with its parent') |
| b69ab31 | | | 218 | : t('Can not fold with parent if this commit is at the bottom') |
| b69ab31 | | | 219 | }> |
| b69ab31 | | | 220 | <Button disabled={!canFold} onClick={handleFoldDown} icon> |
| b69ab31 | | | 221 | <Icon icon="fold-down" /> |
| b69ab31 | | | 222 | </Button> |
| b69ab31 | | | 223 | </Tooltip> |
| b69ab31 | | | 224 | <Tooltip |
| b69ab31 | | | 225 | title={ |
| b69ab31 | | | 226 | canDrop |
| b69ab31 | | | 227 | ? t('Drop the commit in the stack') |
| b69ab31 | | | 228 | : t('Cannot drop this commit because it has dependencies') |
| b69ab31 | | | 229 | }> |
| b69ab31 | | | 230 | <Button disabled={!canDrop} onClick={handleDrop} icon> |
| b69ab31 | | | 231 | <Icon icon="close" /> |
| b69ab31 | | | 232 | </Button> |
| b69ab31 | | | 233 | </Tooltip> |
| b69ab31 | | | 234 | </div> |
| b69ab31 | | | 235 | ); |
| b69ab31 | | | 236 | |
| b69ab31 | | | 237 | const rightSideButtons = ( |
| b69ab31 | | | 238 | <div className="stack-edit-right-side-buttons"> |
| b69ab31 | | | 239 | <Tooltip title={t('Start interactive split for this commit')}> |
| b69ab31 | | | 240 | <Button onClick={handleSplit} icon> |
| b69ab31 | | | 241 | <SplitCommitIcon slot="start" /> |
| b69ab31 | | | 242 | <T>Split</T> |
| b69ab31 | | | 243 | </Button> |
| b69ab31 | | | 244 | </Tooltip> |
| b69ab31 | | | 245 | </div> |
| b69ab31 | | | 246 | ); |
| b69ab31 | | | 247 | |
| b69ab31 | | | 248 | return ( |
| b69ab31 | | | 249 | <Row |
| b69ab31 | | | 250 | data-reorder-id={onDrag ? commit.key : ''} |
| b69ab31 | | | 251 | data-rev={rev} |
| b69ab31 | | | 252 | className={`commit${isReorderPreview ? ' commit-reorder-preview' : ''}`}> |
| b69ab31 | | | 253 | <DragHandle onDrag={onDrag}> |
| b69ab31 | | | 254 | <Icon icon="grabber" /> |
| b69ab31 | | | 255 | </DragHandle> |
| b69ab31 | | | 256 | {buttons} |
| b69ab31 | | | 257 | {title} |
| b69ab31 | | | 258 | {rightSideButtons} |
| b69ab31 | | | 259 | </Row> |
| b69ab31 | | | 260 | ); |
| b69ab31 | | | 261 | } |
| b69ab31 | | | 262 | |
| b69ab31 | | | 263 | /** |
| b69ab31 | | | 264 | * Calculate the reorder "offset" based on the y axis. |
| b69ab31 | | | 265 | * |
| b69ab31 | | | 266 | * This function assumes the stack rev 0 is used as the "public" (or "immutable") |
| b69ab31 | | | 267 | * commit that is not rendered. If that's no longer the case, adjust the |
| b69ab31 | | | 268 | * `invisibleRevCount` accordingly. |
| b69ab31 | | | 269 | * |
| b69ab31 | | | 270 | * This is done by counting how many `.commit`s are below the y axis. |
| b69ab31 | | | 271 | * If nothing is reordered, there should be `rev - invisibleRevCount` commits below. |
| b69ab31 | | | 272 | * The existing `rev`s on the `.commit`s are not considered, as they can be before |
| b69ab31 | | | 273 | * or after the reorder preview, which are noisy to consider. |
| b69ab31 | | | 274 | */ |
| b69ab31 | | | 275 | function calculateReorderOffset( |
| b69ab31 | | | 276 | container: HTMLDivElement, |
| b69ab31 | | | 277 | y: number, |
| b69ab31 | | | 278 | draggingRev: CommitRev, |
| b69ab31 | | | 279 | invisibleRevCount = 1, |
| b69ab31 | | | 280 | ): number { |
| b69ab31 | | | 281 | let belowCount = 0; |
| b69ab31 | | | 282 | const parentY: number = nullthrows(container).getBoundingClientRect().y; |
| b69ab31 | | | 283 | container.querySelectorAll('.commit').forEach(element => { |
| b69ab31 | | | 284 | const commitDiv = element as HTMLDivElement; |
| b69ab31 | | | 285 | // commitDiv.getBoundingClientRect() will consider the animation transform. |
| b69ab31 | | | 286 | // We don't want to be affected by animation, so we use 'container' here, |
| b69ab31 | | | 287 | // assuming 'container' is not animated. The 'container' can be in <ScrollY>, |
| b69ab31 | | | 288 | // and should have a 'relative' position. |
| b69ab31 | | | 289 | const commitY = parentY + commitDiv.offsetTop; |
| b69ab31 | | | 290 | if (commitY > y) { |
| b69ab31 | | | 291 | belowCount += 1; |
| b69ab31 | | | 292 | } |
| b69ab31 | | | 293 | }); |
| b69ab31 | | | 294 | const offset = invisibleRevCount + belowCount - draggingRev; |
| b69ab31 | | | 295 | return offset; |
| b69ab31 | | | 296 | } |
| b69ab31 | | | 297 | |
| b69ab31 | | | 298 | /** Used in undo tooltip. */ |
| b69ab31 | | | 299 | export function UndoDescription({op}: {op?: StackEditOpDescription}): React.ReactElement | null { |
| b69ab31 | | | 300 | if (op == null) { |
| b69ab31 | | | 301 | return <T>null</T>; |
| b69ab31 | | | 302 | } |
| b69ab31 | | | 303 | if (op.name === 'move') { |
| b69ab31 | | | 304 | const {offset, commit} = op; |
| b69ab31 | | | 305 | const depCount = op.depCount ?? 0; |
| b69ab31 | | | 306 | const replace = { |
| b69ab31 | | | 307 | $commit: <CommitTitle commit={commit} />, |
| b69ab31 | | | 308 | $depCount: depCount, |
| b69ab31 | | | 309 | $offset: Math.abs(offset).toString(), |
| b69ab31 | | | 310 | }; |
| b69ab31 | | | 311 | if (offset === 1) { |
| b69ab31 | | | 312 | return <T replace={replace}>moving up $commit</T>; |
| b69ab31 | | | 313 | } else if (offset === -1) { |
| b69ab31 | | | 314 | return <T replace={replace}>moving down $commit</T>; |
| b69ab31 | | | 315 | } else if (offset > 0) { |
| b69ab31 | | | 316 | if (depCount > 0) { |
| b69ab31 | | | 317 | return <T replace={replace}>moving up $commit and $depCount more</T>; |
| b69ab31 | | | 318 | } else { |
| b69ab31 | | | 319 | return <T replace={replace}>moving up $commit by $offset commits</T>; |
| b69ab31 | | | 320 | } |
| b69ab31 | | | 321 | } else { |
| b69ab31 | | | 322 | if (depCount > 0) { |
| b69ab31 | | | 323 | return <T replace={replace}>moving down $commit and $depCount more</T>; |
| b69ab31 | | | 324 | } else { |
| b69ab31 | | | 325 | return <T replace={replace}>moving down $commit by $offset commits</T>; |
| b69ab31 | | | 326 | } |
| b69ab31 | | | 327 | } |
| b69ab31 | | | 328 | } else if (op.name === 'swap') { |
| b69ab31 | | | 329 | return <T>swap the order of two commits</T>; |
| b69ab31 | | | 330 | } else if (op.name === 'fold') { |
| b69ab31 | | | 331 | const replace = {$commit: <CommitTitle commit={op.commit} />}; |
| b69ab31 | | | 332 | return <T replace={replace}>folding down $commit</T>; |
| b69ab31 | | | 333 | } else if (op.name === 'insertBlankCommit') { |
| b69ab31 | | | 334 | return <T>inserting a new blank commit</T>; |
| b69ab31 | | | 335 | } else if (op.name === 'drop') { |
| b69ab31 | | | 336 | const replace = {$commit: <CommitTitle commit={op.commit} />}; |
| b69ab31 | | | 337 | return <T replace={replace}>dropping $commit</T>; |
| b69ab31 | | | 338 | } else if (op.name === 'metaedit') { |
| b69ab31 | | | 339 | const replace = {$commit: <CommitTitle commit={op.commit} />}; |
| b69ab31 | | | 340 | return <T replace={replace}>editing message of $commit</T>; |
| b69ab31 | | | 341 | } else if (op.name === 'import') { |
| b69ab31 | | | 342 | return <T>import</T>; |
| b69ab31 | | | 343 | } else if (op.name === 'fileStack') { |
| b69ab31 | | | 344 | return <T replace={{$file: op.fileDesc}}>editing file stack: $file</T>; |
| b69ab31 | | | 345 | } else if (op.name === 'split') { |
| b69ab31 | | | 346 | return <T replace={{$file: op.path}}>editing $file via interactive split</T>; |
| b69ab31 | | | 347 | } else if (op.name === 'splitWithAI') { |
| b69ab31 | | | 348 | return <T>split with AI</T>; |
| b69ab31 | | | 349 | } else if (op.name === 'absorbMove') { |
| b69ab31 | | | 350 | const replace = {$commit: <CommitTitle commit={op.commit} />}; |
| b69ab31 | | | 351 | return <T replace={replace}>moving a diff chunk to $commit</T>; |
| b69ab31 | | | 352 | } |
| b69ab31 | | | 353 | return <T>unknown</T>; |
| b69ab31 | | | 354 | } |
| b69ab31 | | | 355 | |
| b69ab31 | | | 356 | /** Used in undo tooltip. Styled. */ |
| b69ab31 | | | 357 | function CommitTitle({commit}: {commit: CommitState}): React.ReactElement { |
| b69ab31 | | | 358 | if (commit.originalNodes.contains(WDIR_NODE)) { |
| b69ab31 | | | 359 | return <T>the working copy</T>; |
| b69ab31 | | | 360 | } |
| b69ab31 | | | 361 | return <span className="commit-title">{commit.text.split('\n', 1).at(0)}</span>; |
| b69ab31 | | | 362 | } |