Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add listening ports protocol selector#12915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
f0ssel merged 6 commits intomainfromf0ssel/listening-protocol
Apr 15, 2024

Conversation

f0ssel
Copy link
Contributor

@f0sself0ssel commentedApr 9, 2024
edited
Loading

Relies on#12908 to be merged first.
Closes#12902
Screenshot 2024-04-10 at 12 38 39 PM
Screenshot 2024-04-10 at 12 38 29 PM
Screenshot 2024-04-10 at 12 38 08 PM

Notes:

  • The selector applies to all listening port links
  • The selector also decides the protocol when sharing a listening port with the "Share" button
  • The selector value is saved in localstorage by workspaceID
  • I moved the no detected ports text to a more reactive position and updated helper text

@f0sself0sselforce-pushed thef0ssel/listening-protocol branch from0964e8c toc986370CompareApril 10, 2024 14:49
@f0sself0ssel marked this pull request as ready for reviewApril 10, 2024 16:41
@f0sself0ssel requested review fromaslilac and removed request forBrunoQuaresmaApril 11, 2024 16:51
</Stack>
{filteredListeningPorts.length === 0 && (
<HelpTooltipText css={styles.noPortText}>
{"No open ports were detected."}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{"No open ports were detected."}
Noopenportsweredetected.

Comment on lines 256 to 258
{
"The listening ports are exclusively accessible to you. Selecting HTTP/S will change the protocol for all listening ports."
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
"The listening ports are exclusively accessible to you. Selecting HTTP/S will change the protocol for all listening ports."
}
Thelisteningportsareexclusivelyaccessibletoyou.Thisoptionwillchangetheprotocolforalllisteningports.

Comment on lines 199 to 209
const filteredListeningPorts = (listeningPorts ? listeningPorts : []).filter(
(port) => {
for (let i = 0; i < filteredSharedPorts.length; i++) {
if (filteredSharedPorts[i].port === port.port) {
return false;
}
}
}

return true;
});
return true;
},
);
Copy link
Member

@aslilacaslilacApr 11, 2024
edited
Loading

Choose a reason for hiding this comment

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

Suggested change
constfilteredListeningPorts=(listeningPorts ?listeningPorts :[]).filter(
(port)=>{
for(leti=0;i<filteredSharedPorts.length;i++){
if(filteredSharedPorts[i].port===port.port){
returnfalse;
}
}
}
returntrue;
});
returntrue;
},
);
constfilteredListeningPorts=(listeningPorts??[]).filter(
(port)=>filteredSharedPorts.every((sharedPort)=>sharedPort.port!==port.port),
);

Comment on lines +69 to +85
export const saveWorkspaceListeningPortsProtocol = (
workspaceID: string,
protocol: WorkspaceAgentPortShareProtocol,
) => {
localStorage.setItem(
`listening-ports-protocol-workspace-${workspaceID}`,
protocol,
);
};

export const getWorkspaceListeningPortsProtocol = (
workspaceID: string,
): WorkspaceAgentPortShareProtocol => {
return (localStorage.getItem(
`listening-ports-protocol-workspace-${workspaceID}`,
) || "http") as WorkspaceAgentPortShareProtocol;
};
Copy link
Member

Choose a reason for hiding this comment

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

I'm always wary of usinglocalStorage for stuff like this. Can you share some of your rationale?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I am too. We have had many group discussions (dean, jon, kyle, ben) around a few of the PRs coming out of Shared Ports about these protocol selection features. I've suggested keeping this state and other UX state in the DB in the past, but the group thought that putting this button in local storage is better than making a new table to track this stuff. We want an MVP that is feature complete, but can still iterate on later as we get customer feedback, and this was the solution we landed on for now.

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha. If it changes the protocol ofall ports though, is it really "UI state"?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I promise you I have brought up many different discussions about doing things with this on the backend but the conclusion the group came to was client side storage for now and that we can iterate on the design once we get feedback.

aslilac reacted with thumbs up emoji
@f0sself0ssel merged commit3ab5a51 intomainApr 15, 2024
@f0sself0ssel deleted the f0ssel/listening-protocol branchApril 15, 2024 19:00
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsApr 15, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@aslilacaslilacaslilac approved these changes

@sreyasreyaAwaiting requested review from sreya

@stirbystirbyAwaiting requested review from stirby

Assignees

@f0sself0ssel

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

add http/https button for listening ports
2 participants
@f0ssel@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp