Repository navigation
Code surface: editor and terminal chrome (ATL-874) - #20
Merged
Merged
Conversation
…mbs, EditorStatusBar, EditorPreview, FindBar, TerminalBlock, TerminalOutput, TerminalCommandInput, TerminalStatus, CommandSuggestions, TerminalStopControl, TerminalPalette), the syntax/editor/terminal colour bridges, and their helpers
… its completions without a combobox role (not allowed on a textarea), the completion popup is named, and the scrolling preview takes focus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ATL-874: the editor and terminal chrome, copied from desktop (0.4.1) into a new
src/components/code-surface/group, props-only, with a story for each. CodeMirror, xterm, the PTY and the line emulator stay in desktop.EditorFrame(header band, warning notice row, find-bar slot, status-bar slot),EditorBreadcrumbs(desktop's crumb look, middle folds into one ellipsis),EditorStatusBar,EditorPreview(a static excerpt drawn the waybuild-cm-theme.tsdraws a file: change bars, numbers, folds, active line, selection, matches, bracket, caret), andFindBar(desktop'sFileFindBarlook, plus the options, replace, and Select all matches).TerminalBlock(desktop'sBlockCard),TerminalOutputand the memoisedTerminalOutputLine,TerminalCommandInputandTerminalStatus,CommandSuggestions(Base UI Popover, non-modal, never takes focus),TerminalStopControl(desktop's phase machine), andTerminalPalette.code-surface.ts:pathSegments(fixes the/a/bvs/a/bc/xroot bug),collapseSegments,formatDuration(fixes 59,999 ms printing "60s"),highlightRanges,segmentClassName, and the literalSYNTAX_TEXT_CLASS,ANSI_TEXT_CLASSandANSI_BG_CLASStables.TerminalSegmenttakes desktop'sAnsiSegmentandLinkedRunwithout a cast.utilities.css:--color-syntax-*,--color-editor-*,--color-search-match-*,--color-diff-{added,removed}-textand--color-terminal-*, each named after its theme key, as the other roles are.Where this differs from the issue's spec, and why
src/components/code-surface/, notsrc/components/patterns/code-surface/.storybook:smokeonly checks one level undersrc/components/<group>/, so a nested folder would have gone unchecked. Stories live instories/components/code-surface/as the smoke test expects, andCommandSuggestionshas a small story of its own for the same reason.CommandInputis exported asTerminalCommandInput, becauseCommandInputis already the command palette's input insrc/ui/command.tsx.text-xsbreadcrumbs, not mono.TerminalOutputsits on the card intext-secondary-foregroundat desktop's 1.4 leading, not onbg-terminal-background. "No results" is muted, nottext-error. The suggestions footer is desktop's plain text, not aKbdGroup. The px sizes (260/460px popup, the 29px command row, the 3px change bar, the 2px caret) are desktop's, since the spec's rem steps come out smaller at the 13px root.aria-autocomplete,aria-controlsandaria-activedescendant, notrole="combobox". ARIA does not allow that role on a<textarea>, and the Storybook axe run fails on it.matchIndexis 0-based (nullor unset means no current match).Upgrade notes (for the next release's README)
src/components/code-surface/, all on the root entry):EditorFrame,EditorBreadcrumbs,EditorStatusBar,EditorPreview,FindBar,TerminalBlock,TerminalOutput,TerminalOutputLine,TerminalCommandInput,TerminalStatus,CommandSuggestions,TerminalStopControlandTerminalPalette, plus the helpers and types incode-surface.ts.text-syntax-keyword,bg-editor-selection-background,bg-search-match-background,bg-diff-added-text,text-terminal-ansi-red, and so on. Before this, these were app-owned roles.Evidence
All gates are green locally on the branch, rebased onto
mainat #18:typecheck,format:checkandtheme:checkpass.testpasses 417 tests.tests/code-surface.test.tscovers the helper tables,expectBridged, the type check, the Unicode and regex-escape cases forhighlightRanges, andformatDurationat 999.6.src/components/code-surface/code-surface.test.tsxcovers component behaviour: keys, counts, copy timer, collapse, links, memo, the stop phases, and focus kept on suggestion press.build,test:consumer,build-storybookandstorybook:smokepass. Smoke reports 90 component files and 640 stories.test:storybookpasses 640 tests with axe, including every new play: FindBar Matches and SelectAll, TerminalBlock Succeeded, Links, SearchHighlight, MemoisedLines and CommandHighlight, CommandInput Suggestions, and TerminalStopControl Ready.EditorFrame/PhoneandTerminalCommandInput/NarrowStatushave no horizontal overflow at 375px. The screenshots are local, inshots/ATL-874/.Merge Danger
Low. The change is additive: new exports and new
--color-*bridges. No existing component or utility changed, apart from a README table row and the formatter reflowing that table.TerminalPalettehas its own story.TerminalBlockinside the package'sToolCallCardis a follow-up.EditorStatusBarandTerminalStatusare built to the spec, but desktop doesn't render either today (term-githas the data but no UI).