Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read CLI parameters #312

Merged
merged 14 commits into from
Dec 19, 2024
Merged

Read CLI parameters #312

merged 14 commits into from
Dec 19, 2024

Conversation

aneuwald-ctw
Copy link
Contributor

@aneuwald-ctw aneuwald-ctw commented Dec 18, 2024

User-Facing Changes
Users were not allowed to use custom flags when opening Lichtblick.

Description

  • Introduced the AppParameters provider, which accepts a Record<string, string> input and allows other components to access these global parameters.

  • Implemented the flow for the desktop application to read CLI parameters starting with -- and parse them into an object if the input is valid.

  • This mechanism is reusable, for example, to parse URL parameters from the web version and pass them to the same "agnostic" provider.

In order to test in development mode, it is just execute the command yarn desktop:start --defaultLayout=<SOME_LAYOUT> after serving the development server.

In production, it should be done something like this:

  • Linux: lichtblick --layoutDefault="layout_example"
  • MacOS: /Applications/Lichtblick.app/Contents/MacOS/Lichtblick --layoutDefault="layout_example"
  • Windows: C:\Users\<USER>\AppData\Local\Programs\lichtblick\Lichtblick.exe --layoutDefault="layout_example"

image

Checklist

  • The desktop version was tested and it is running ok
  • This change is covered by unit tests
  • Files constants.ts, types.ts and *.style.ts have been checked and relevant code snippets have been relocated

@aneuwald-ctw aneuwald-ctw added the enhancement New feature or request label Dec 18, 2024
@laisspportugal
Copy link
Contributor

Very nice implementation, congrats on that.
I've tested using one valid layout and one layout that was not present locally and it worked fine.

ctw-joao-luis
ctw-joao-luis previously approved these changes Dec 19, 2024
@aneuwald-ctw aneuwald-ctw merged commit fd7c502 into main Dec 19, 2024
11 checks passed
@aneuwald-ctw aneuwald-ctw deleted the feature/read-cli-parameters branch December 19, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants