zowe / zowe-explorer-vscode

Visual Studio Code Extension for Zowe, which lets users interact with z/OS Data Sets, Unix System Services, and Jobs on a remote mainframe instance. Powered by Zowe SDKs.
Eclipse Public License 2.0
173 stars 92 forks source link

Decouple search logic from tree view (specifically jobs) #3052

Open traeok opened 3 months ago

traeok commented 3 months ago

Is your feature request related to a problem? Please describe.

Currently the quick picks and all related UX for searching is tightly coupled within the tree views. This means we cannot spawn the same dialogs without duplicating existing code, especially in a context where we don't want to use a node when performing the search.

Describe the solution you'd like

It would be nice to separate this logic out so that it can be used for other use cases. A generic function that prompts the user for these values would avoid the need to duplicate the same quick pick logic elsewhere. Here's an example for the jobs tree:

interface JobSearch {
    owner: string;
    prefix: string;
    status: string;
};
function jobSearchPrompt(): Promise<JobSearch> {
    // prompting logic here...
    return {
        owner: owner ?? "*",
        prefix: prefix ?? "*",
        status: status ?? "*",
    };
}

Describe alternatives you've considered

We could duplicate the same search/prompt code everywhere we need to use it, but this is really bad practice and results in having to maintain two different areas containing the same logic.

Additional context

This was brought up as an enhancement request for #3050. Having a function such as the example above will allow us to quickly execute searches without relying on the tree view or binding a search result to a specific profile node. This is somewhat available in the Dataset and USS trees (as we can lookup using the FileSystemProviders), but the prompts are still tightly coupled to the trees.

github-actions[bot] commented 3 months ago

Thank you for raising this enhancement request. The community has 90 days to vote on it. If the enhancement receives at least 10 upvotes, it is added to our development backlog. If it receives fewer votes, the issue is closed.