/* Changes view: the source header, the toolbar, notices, then one scrolling list of file sections whose headers stick while their lines scroll. */ .root { container: forge-changes / inline-size; --forge-changes-bg: var(--dsw-alias-bg-base); --forge-fill: var(--dsw-alias-card-fill); --forge-diff-empty: color-mix(in srgb, var(--dsw-alias-interactive-bg-hover) 50%, transparent); display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--forge-changes-bg); color: var(--dsw-alias-label-primary); font-size: 12px; line-height: 18px; } .header { display: flex; flex: none; align-items: center; gap: 8px; box-sizing: border-box; min-height: 44px; padding: 0 8px 0 14px; border-bottom: 0.5px solid var(--dsw-alias-border-l3); } .headerIcon { display: inline-flex; flex: none; color: var(--dsw-alias-label-secondary); } .headerTitle { min-width: 0; overflow: hidden; font-size: 13px; font-weight: 500; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; } .headerNumber { flex: none; color: var(--dsw-alias-label-tertiary); font-family: var(--ds-font-family-code); } .headerNote { min-width: 0; overflow: hidden; color: var(--dsw-alias-label-secondary); text-overflow: ellipsis; white-space: nowrap; } /* The checked-out branch gives way first, so the base branch stays readable. */ .headerHead { flex: 0 100 auto; min-width: 2.5em; overflow: hidden; color: var(--dsw-alias-label-secondary); font-family: var(--ds-font-family-code); text-overflow: ellipsis; white-space: nowrap; } .headerArrow { flex: none; color: var(--dsw-alias-label-tertiary); } .headerSuffix { color: var(--dsw-alias-label-tertiary); } @container forge-changes (max-width: 520px) { .headerSuffix { display: none; } } @container forge-changes (max-width: 380px) { .headerHead, .headerArrow { display: none; } } .headerEnd { display: inline-flex; flex: 0 1 auto; align-items: center; gap: 4px; min-width: 0; margin-left: auto; } .toolbar { display: flex; flex: none; align-items: stretch; box-sizing: border-box; border-bottom: 0.5px solid var(--dsw-alias-border-l3); } /* Spans the file tree's width with the tree's search inset, and its divider continues the tree's border. */ .lensCell { display: none; flex: none; align-items: center; box-sizing: border-box; width: var(--forge-tree-width); padding: 0 8px; border-inline-end: 0.5px solid var(--dsw-alias-border-l3); } .toolbar[data-tree='right'] .lensCell { order: 1; border-inline-start: 0.5px solid var(--dsw-alias-border-l3); border-inline-end: 0; } .toolbarMain { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 0 4px; box-sizing: border-box; min-width: 0; min-height: 38px; padding: 5px 8px; } .lensMenu { display: inline-flex; } @container forge-changes (min-width: 760px) { .toolbar:not([data-tree='hidden']) .lensCell { display: flex; } .toolbar:not([data-tree='hidden']) .lensMenu { display: none; } } .spacer { flex: 1; } .progressSlot { display: inline-flex; } /* Breaks the toolbar's review controls onto a second row where one row is too narrow for them. */ .rowBreak { display: none; } @container forge-changes (max-width: 640px) { .reviewRow { order: 2; } .rowBreak { display: block; flex-basis: 100%; order: 1; height: 4px; } .progressSlot { margin-left: auto; } } .select { display: inline-flex; flex: 0 1 auto; align-items: center; gap: 4px; box-sizing: border-box; min-width: 0; height: 28px; padding: 0 6px 0 8px; border: 0; border-radius: var(--dsw-radius-sm); background: transparent; color: var(--dsw-alias-label-primary); cursor: pointer; font: inherit; white-space: nowrap; } .select[aria-expanded='true'] { background: var(--dsw-alias-interactive-bg-hover); } @media (hover: hover) { .select:hover { background: var(--dsw-alias-interactive-bg-hover); } } .select:disabled { color: var(--dsw-alias-label-tertiary); cursor: default; } @media (hover: hover) { .select:disabled:hover { background: transparent; } } .select svg { flex: none; } .counts { display: inline-flex; flex: none; gap: 6px; font-family: var(--ds-font-family-code); } .totals { padding: 0 4px; } .added { color: var(--dsw-alias-state-success-primary); } .deleted { color: var(--dsw-alias-state-error-primary); } .tools { display: inline-flex; flex: none; align-items: center; gap: 2px; } .tool { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--dsw-radius-sm); background: transparent; color: var(--dsw-alias-label-secondary); cursor: pointer; } .tool[aria-pressed='true'], .tool[aria-expanded='true'], .tool[data-expanded] { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); } @media (hover: hover) { .tool:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); } } .tool:disabled { color: var(--dsw-alias-label-tertiary); cursor: default; } .tool svg { width: 15px; height: 15px; } .tool[aria-pressed='true'] .compareIcon { transform: rotate(90deg); } /* A menu row with a path that shortens and its counts. */ .menuRow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; } .menuPath { flex: 1; min-width: 0; } .menuList { min-width: 280px; max-width: min(420px, 80vw); } .notice { display: flex; flex: none; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 0.5px solid var(--dsw-alias-border-l3); background: var(--forge-fill); color: var(--dsw-alias-label-secondary); } .notice > svg { flex: none; } .noticeAction { flex: none; margin-left: auto; } .body { position: relative; display: flex; flex: 1; min-height: 0; } .treeToggle { display: none; } @container forge-changes (min-width: 760px) { .treeToggle { display: inline-flex; } .treePane:not([hidden]) { display: block; } } .files { --forge-files-inset: 10px; flex: 1; box-sizing: border-box; min-width: 0; min-height: 0; padding: var(--forge-files-inset); overflow: auto; } .files:focus { outline: none; } /* The actions of a failed read, side by side. */ .actions { display: flex; gap: 8px; } /* Loading, empty, and failed states without changes to show. */ .centered { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; padding: 24px; color: var(--dsw-alias-label-secondary); font-size: var(--dsh-content-font-size-secondary, 13px); text-align: center; } /* Each file is one card, so a file's last collapsed-context strip and the next file's header no longer read as adjacent rows. Diffs share R16; clip, unlike hidden, keeps the card from becoming the sticky header's scroll container. */ .file { overflow: clip; border: 0.5px solid var(--dsw-alias-border-l4); border-radius: var(--dsw-radius-lg); background: var(--forge-changes-bg); } .file + .file { margin-top: 12px; } @container forge-changes (max-width: 380px) { .files { --forge-files-inset: 6px; } .file + .file { margin-top: 8px; } } /* Above the comment plus (z-index 1) of rows scrolled beneath it. Sticky offsets start inside the list's padding, so the negative inset keeps a stuck header flush with the scroll area's top edge. */ .fileHeader { position: sticky; top: calc(-1 * var(--forge-files-inset, 0px)); z-index: 2; display: flex; align-items: center; gap: 6px; box-sizing: border-box; min-height: 36px; padding: 0 4px 0 8px; border-bottom: 0.5px solid var(--dsw-alias-border-l3); /* The hover tint over the view background stays opaque while code scrolls beneath the sticky header. */ background: linear-gradient(var(--dsw-alias-interactive-bg-hover), var(--dsw-alias-interactive-bg-hover)), var(--forge-changes-bg); } /* A bare chevron: its rotation shows whether the file is expanded, so it takes no fill in any state. */ .fileToggle { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 20px; height: 24px; padding: 0; border: 0; border-radius: var(--dsw-radius-sm); background: transparent; color: var(--dsw-alias-label-tertiary); cursor: pointer; } @media (hover: hover) { .fileToggle:hover { color: var(--dsw-alias-label-primary); } } .file:not([data-expanded]) .fileHeader { border-bottom: 0; } /* The file's own information gives way inside this box, so the counts, the viewed mark, and the menu after it stay whole at any width. */ .fileTitle { display: flex; flex: 1 1 0; align-items: center; gap: 6px; min-width: 0; overflow: hidden; } .fileIcon { flex: none; } /* The path shares the shortage with the badge in proportion to their widths, so the longer path keeps the larger part and stays under the pointer for its full-path tooltip. */ .filePath { display: flex; flex: 0 1 auto; min-width: 0; } .fileSpacer { flex: 1; align-self: stretch; } .chevron { transition: transform 120ms ease; } .file:not([data-expanded]) .chevron { transform: rotate(-90deg); } /* Capped rather than shrunk, so a long path never truncates the tag; a longer translation ends in an ellipsis. */ .changedTag { flex: none; max-width: 30%; } .changedText { min-width: 0; overflow: hidden; text-overflow: ellipsis; } /* The viewed mark: a native checkbox with its label as one bordered chip, peer to the file menu button. */ .viewed { display: inline-flex; flex: none; align-items: center; gap: 6px; box-sizing: border-box; height: 24px; padding: 0 8px 0 6px; border: 0.5px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-sm); color: var(--dsw-alias-label-secondary); white-space: nowrap; cursor: pointer; user-select: none; } .viewed input { margin: 0; accent-color: var(--dsw-alias-state-business-primary); cursor: pointer; } .viewed:has(input:checked) { background: var(--dsw-alias-interactive-bg-hover); } @media (hover: hover) { .viewed:hover { color: var(--dsw-alias-label-primary); } } .viewed:has(input:focus-visible) { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: -1px; } .viewed input:focus-visible { outline: none; } @container forge-changes (max-width: 520px) { .viewed { padding: 0 6px; } .viewedLabel { display: none; } } .badge { flex: 0 1 auto; min-width: 0; max-width: 50%; overflow: hidden; padding: 0 6px; border-radius: 4px; background: var(--forge-fill); color: var(--dsw-alias-label-secondary); font-size: 11px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; } /* Lines of one file: one column of grid rows, or two cells per row side by side. */ .code { overflow-x: auto; font: var(--dsw-font-markdown-code-block); } /* An expanded file the reader has not scrolled near yet: one 22px row (`.line`) per drawn line, so the scroll range and the positions of the files below stay close to their drawn values. */ .unreached { height: calc(var(--forge-rows) * 22px); } /* One intrinsic-width track paints every unwrapped unified row across the scrolled width. */ .code:not([data-wrap]):not([data-split]) { display: grid; grid-template-columns: minmax(max-content, 100%); } .line { display: grid; grid-template-columns: var(--forge-number-width, 3.5em) var(--forge-number-width, 3.5em) 1.4em minmax(0, 1fr); box-sizing: border-box; min-height: 22px; line-height: 22px; white-space: pre; } .code:not([data-wrap]):not([data-split]) .line { grid-template-columns: var(--forge-number-width, 3.5em) var(--forge-number-width, 3.5em) 1.4em max-content; } .pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 22px; line-height: 22px; white-space: pre; } .cell { display: grid; grid-template-columns: var(--forge-number-width, 3.5em) minmax(0, 1fr); box-sizing: border-box; min-width: 0; } .cell + .cell { border-left: 0.5px solid var(--dsw-alias-border-l3); } /* Unwrapped side-by-side cells cut long lines at the column edge. */ .cell .text { overflow: hidden; } .code[data-wrap] .line, .code[data-wrap] .pair { white-space: pre-wrap; } .code[data-wrap] .text { overflow-wrap: anywhere; } .number { box-sizing: border-box; padding-right: 6px; color: var(--dsw-alias-label-tertiary); text-align: right; user-select: none; } .sign { text-align: center; user-select: none; } .text { padding: 0 16px 0 6px; } /* Side-by-side cells have no sign column, so commentable code keeps one as an empty lane for the comment plus. */ .code[data-split][data-review] .text { padding-left: calc(1.4em + 6px); } .add { --forge-diff-gutter: var(--dsw-alias-file-diff-added-gutter); --forge-diff-marker: var(--dsw-alias-file-diff-added-marker); background: var(--dsw-alias-file-diff-added-bg); } .del { --forge-diff-gutter: var(--dsw-alias-file-diff-deleted-gutter); --forge-diff-marker: var(--dsw-alias-file-diff-deleted-marker); background: var(--dsw-alias-file-diff-deleted-bg); } .add .number, .del .number { background: var(--forge-diff-gutter); color: var(--forge-diff-marker); } .add .sign, .del .sign { color: var(--forge-diff-marker); } .context .text { color: var(--dsw-alias-label-secondary); } .empty { background: var(--forge-diff-empty); } /* Collapsed unchanged lines; the row expands them. */ /* Collapsed unchanged lines, a collapsed large file, and a file whose lines cannot be drawn share one strip; only the first two open on a click. */ .gap, .fileNote { display: flex; align-items: center; gap: 6px; box-sizing: border-box; width: 100%; min-height: 26px; margin: 0; padding: 0 12px; border: 0; background: var(--forge-fill); color: var(--dsw-alias-label-tertiary); font-family: var(--dsw-font-family); font-size: 12px; line-height: 18px; text-align: left; } .gap { cursor: pointer; } @media (hover: hover) { .gap:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); } } .gap:disabled { cursor: progress; } /* The local changes card of the panel: its toggle and refs, the view link and create action, then its files. */ .local { min-width: 0; border: 0.5px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-md); background: var(--dsw-alias-bg-layer-1); } .localHead { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 12px 2px 6px; } .localToggle { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 26px; padding: 0 6px; border: 0; border-radius: var(--dsw-radius-sm); background: transparent; color: var(--dsw-alias-label-primary); cursor: pointer; font: inherit; font-weight: 500; } @media (hover: hover) { .localToggle:hover { background: var(--dsw-alias-interactive-bg-hover); } } .localToggle svg { color: var(--dsw-alias-label-tertiary); transition: transform 120ms ease; } .localToggle[aria-expanded='true'] svg { transform: rotate(180deg); } .localRefs { min-width: 0; margin-left: auto; overflow: hidden; color: var(--dsw-alias-label-tertiary); font-family: var(--ds-font-family-code); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; } .localRow { display: flex; align-items: center; gap: 8px; padding: 4px 10px 10px 12px; font-size: 12px; } .localView { display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 28px; margin-left: -6px; padding: 0 6px; border: 0; border-radius: var(--dsw-radius-sm); background: transparent; color: var(--dsw-alias-label-secondary); cursor: pointer; font: inherit; } @media (hover: hover) { .localView:hover { background: var(--dsw-alias-interactive-bg-hover); } } .localCreate { flex: none; margin-left: auto; } .localFiles { margin: 0; padding: 4px 6px 8px; border-top: 0.5px solid var(--dsw-alias-border-l2); list-style: none; } .localFile { display: flex; align-items: center; gap: 8px; box-sizing: border-box; width: 100%; min-height: 28px; padding: 0 6px; border: 0; border-radius: var(--dsw-radius-sm); background: transparent; color: var(--dsw-alias-label-primary); cursor: pointer; font: inherit; font-size: 12px; text-align: left; } @media (hover: hover) { .localFile:hover { background: var(--dsw-alias-interactive-bg-hover); } } .localFile .menuPath { flex: 1; } .localView:focus-visible, .localToggle:focus-visible, .fileToggle:focus-visible, .localFile:focus-visible, .select:focus-visible, .gap:focus-visible { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: -2px; } .reviewNotice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; } .code[data-split][data-native-side="L"] [data-diff-side="R"], .code[data-split][data-native-side="L"] [data-diff-side="R"] *, .code[data-split][data-native-side="R"] [data-diff-side="L"], .code[data-split][data-native-side="R"] [data-diff-side="L"] * { user-select: none; } .reviewSubmit { flex: none; white-space: nowrap; } .code[data-single-side] .line { grid-template-columns: var(--forge-number-width) 1.4em minmax(0, 1fr); } .code[data-single-side]:not([data-wrap]) .line { grid-template-columns: var(--forge-number-width) 1.4em max-content; } .reviewFile { padding: 12px 0; } .reviewFile > h3 { margin: 0 10px; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; } /* The unresolved thread count of a file opens the thread list at the file. */ .threadCount { flex: none; height: 20px; padding: 0 6px; border: 0; border-radius: var(--dsw-radius-xs); background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent); color: var(--dsw-alias-state-business-primary); font: inherit; font-size: 11px; line-height: 20px; white-space: nowrap; cursor: pointer; } /* Drawn inside the button, since the file title clips what overflows it. */ .threadCount:focus-visible { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: -1px; } @media (hover: hover) { .threadCount:hover { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 20%, transparent); } } /* A view narrower than 480px shows the count alone. */ .threadCountNumber { display: none; } @container forge-changes (max-width: 479px) { .threadCountText { display: none; } .threadCountNumber { display: inline; } } /* Opens the thread list; pressed while the list shows. */ .threadsToggle { display: inline-flex; flex: none; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 0; border-radius: var(--dsw-radius-sm); background: transparent; color: var(--dsw-alias-label-primary); font: inherit; white-space: nowrap; cursor: pointer; } .threadsToggle[aria-pressed='true'] { background: var(--dsw-alias-interactive-bg-hover); } @media (hover: hover) { .threadsToggle:hover { background: var(--dsw-alias-interactive-bg-hover); } } .threadsTotal { padding: 0 5px; border-radius: var(--dsw-radius-xs); background: var(--forge-fill); color: var(--dsw-alias-label-secondary); font-size: 11px; line-height: 16px; }