Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Preserve focus on results viewer when showing a location in a file. [#3088](https://github.com/github/vscode-codeql/pull/3088)
- The `dataflowtracking` and `tainttracking` snippets expand to the new module-based interface. [#3091](https://github.com/github/vscode-codeql/pull/3091)
- The compare view will now show a loading message while the results are loading. [#3107](https://github.com/github/vscode-codeql/pull/3107)
- Make top-banner of the model editor sticky [#3120](https://github.com/github/vscode-codeql/pull/3120)

## 1.10.0 - 16 November 2023

Expand Down
48 changes: 27 additions & 21 deletions extensions/ql-vscode/src/view/model-editor/ModelEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ const LoadingContainer = styled.div`
font-weight: 600;
`;

const ModelEditorContainer = styled.div`
margin-top: 1rem;
`;
const ModelEditorContainer = styled.div``;

const HeaderContainer = styled.div`
display: flex;
flex-direction: row;
align-items: end;
background-color: var(--vscode-editorGutter-background);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason why this is editorGutter-background rather than editor-background? Usually these two colors match, but if we want to match the background color of the webview, we should use editor-background.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, just a mistake when copying the variable. Updated it!

position: sticky;
z-index: 1;
top: 0;
padding-top: 1rem;
padding-bottom: 1rem;
`;

const HeaderColumn = styled.div`
Expand Down Expand Up @@ -67,7 +71,7 @@ const EditorContainer = styled.div`
const ButtonsContainer = styled.div`
display: flex;
gap: 0.4em;
margin-bottom: 1rem;
margin-top: 1rem;
`;

type Props = {
Expand Down Expand Up @@ -300,6 +304,25 @@ export function ModelEditor({
</LinkIconButton>
)}
</HeaderRow>
<HeaderRow>
<ButtonsContainer>
<VSCodeButton
onClick={onSaveAllClick}
disabled={modifiedSignatures.size === 0}
>
Save all
</VSCodeButton>
<VSCodeButton appearance="secondary" onClick={onRefreshClick}>
Refresh
</VSCodeButton>
{viewState.showGenerateButton &&
viewState.mode === Mode.Framework && (
<VSCodeButton onClick={onGenerateFromSourceClick}>
Generate
</VSCodeButton>
)}
</ButtonsContainer>
</HeaderRow>
</HeaderColumn>
<HeaderSpacer />
<HeaderColumn>
Expand All @@ -313,23 +336,6 @@ export function ModelEditor({
</HeaderContainer>

<EditorContainer>
<ButtonsContainer>
<VSCodeButton
onClick={onSaveAllClick}
disabled={modifiedSignatures.size === 0}
>
Save all
</VSCodeButton>
<VSCodeButton appearance="secondary" onClick={onRefreshClick}>
Refresh
</VSCodeButton>
{viewState.showGenerateButton &&
viewState.mode === Mode.Framework && (
<VSCodeButton onClick={onGenerateFromSourceClick}>
Generate
</VSCodeButton>
)}
</ButtonsContainer>
<ModeledMethodsList
methods={methods}
modeledMethodsMap={modeledMethods}
Expand Down