Skip to content

Conversation

@interim17
Copy link
Contributor

Time Estimate or Size

medium

Problem

Starting work on #428

Solution

  • adds constants file
  • adds types file
  • moves into new Components directory: RecordMoviesComponent, ColorPicker, AgentMetadata, ConversionForm
  • adds stylesheet
  • indicates which UI elements have been factored into separate components by wrapping them in a border and some padding

Screenshot 2024-11-08 at 4 21 34 PM

@github-actions
Copy link

github-actions bot commented Nov 9, 2024

Coverage report

St.
Category Percentage Covered / Total
🔴 Statements 42.38% 2160/5097
🔴 Branches 45.03% 910/2021
🔴 Functions 38.98% 451/1157
🔴 Lines 42.62% 2071/4859

Test suite run success

144 tests passing in 16 suites.

Report generated by 🧪jest coverage report action from e1c5555

const getContents = () => {
if (agentData.instanceId === -1) {
return <div>No agent selected</div>;
return <div className="ui-container">No agent selected</div>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Existing custom components get this wrapper to show what they contain, goal is to factor all the loose UI html into components and then get it into a scheme.

Comment on lines +51 to +54
<div className="ui-container">
<button onClick={() => setRecordingEnabled()}>
{isRecordingEnabled ? "Disable" : "Enable"} Recording
</button>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this into the component so that recording related things are all contained inside the ui-container class.

@interim17 interim17 marked this pull request as ready for review November 9, 2024 00:25
@interim17 interim17 requested a review from a team as a code owner November 9, 2024 00:25
@interim17 interim17 requested review from frasercl and meganrm and removed request for a team November 9, 2024 00:25
Copy link
Contributor

@frasercl frasercl left a comment

Choose a reason for hiding this comment

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

Looks good, like the organization! Suggested a couple minor edits

Copy link
Contributor

Choose a reason for hiding this comment

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

Optional: while you're here, this file uses a lodash map that could be replaced by a native map

Copy link
Contributor

Choose a reason for hiding this comment

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

InputSwitch has one too, and CollectionInput has a map and a reduce

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Taking suggestion to remove the lodash map from ConversionForm, but leaving the calls in InputSwitch and CollectionInput for now.

The input collections are objects not arrays, so that actually is the use case for the lodash map and reduce as I understand them and so feels out of scope to change rn.

Comment on lines +474 to +476
if (
isEqual(uiDisplayData, this.state.selectionStateInfo.appliedColors)
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

idk if anyone's especially committed to it, but hot take this repo's 80 column limit is a bit too small

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sizzler! I like it though... @meganrm what do you think about bumping the prettier printWidth to 120? We will vibe with volume-viewer then.

AICS style guide anyone? Would actually be nice if this sort of thing was consistent across repos.

Copy link
Contributor

Choose a reason for hiding this comment

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

that's fine with me

@@ -1,13 +1,18 @@
import { set } from "lodash";
Copy link
Contributor

Choose a reason for hiding this comment

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

linter says this is unused - accidental auto-import?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sigh

};

return <div>Agent Metadata: {getContents()}</div>;
return getContents();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can delete getContents and turn its returns into this component's returns

@interim17 interim17 merged commit cf905dd into main Nov 18, 2024
@interim17 interim17 deleted the maintenance/testbed-organization branch November 18, 2024 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants