Skip to content

Desktop: Add support for opening a .graphite file from a path passed as a launch argument#3059

Merged
timon-schelling merged 19 commits intoGraphiteEditor:masterfrom
c-mateo:3054-open-doc-from-cli
Oct 13, 2025
Merged

Desktop: Add support for opening a .graphite file from a path passed as a launch argument#3059
timon-schelling merged 19 commits intoGraphiteEditor:masterfrom
c-mateo:3054-open-doc-from-cli

Conversation

@c-mateo
Copy link
Copy Markdown
Contributor

@c-mateo c-mateo commented Aug 17, 2025

Closes #3054

@Keavon
Copy link
Copy Markdown
Member

Keavon commented Aug 18, 2025

Neither of your gitignore changes seem to make sense to me. Can you justify or remove them?

@Keavon Keavon requested review from TrueDoctor and timon-schelling and removed request for TrueDoctor August 18, 2025 05:45
@Keavon Keavon changed the title Open document from cli and add some files to .gitignore Add support for opening a .graphite file from a path passed as launch arguments Aug 18, 2025
@Keavon Keavon changed the title Add support for opening a .graphite file from a path passed as launch arguments Add support for opening a .graphite file from a path passed as a launch argument Aug 18, 2025
@timon-schelling
Copy link
Copy Markdown
Member

timon-schelling commented Aug 18, 2025

I would generally prefer a proper cli implementation from the beginning (with clap etc.), not a temporary solution for only implementing file opening.

@TrueDoctor I would need to implement basically all of this in my wrapper crate pr (#3039). Would you be fine with waiting with features that will have a easy way of implementing once the wrapper crate separation is done?

@c-mateo
Copy link
Copy Markdown
Contributor Author

c-mateo commented Aug 18, 2025

Neither of your gitignore changes seem to make sense to me. Can you justify or remove them?

I added those lines because I haven't created those folders but they were there as a result of a compilation step. Let me remove them.

@Keavon
Copy link
Copy Markdown
Member

Keavon commented Aug 30, 2025

I would generally prefer a proper cli implementation from the beginning (with clap etc.), not a temporary solution for only implementing file opening.

@TrueDoctor I would need to implement basically all of this in my wrapper crate pr (#3039). Would you be fine with waiting with features that will have a easy way of implementing once the wrapper crate separation is done?

Are you in favor of closing this, then? I'll defer to your thinking on this.

@timon-schelling
Copy link
Copy Markdown
Member

@c-mateo are you still interested in working on this? Would need a complete rework now that 3039 is merged.

And I would still prefer implementing this with clap.

@timon-schelling timon-schelling marked this pull request as draft August 31, 2025 11:06
@Keavon
Copy link
Copy Markdown
Member

Keavon commented Aug 31, 2025

I'll close this for now then, @timon-schelling's requested changes can be either a new PR or be part of this PR and reopened.

@Keavon Keavon closed this Aug 31, 2025
@c-mateo
Copy link
Copy Markdown
Contributor Author

c-mateo commented Sep 23, 2025

Now the cli is properly implemented using clap and there's an option to select whether you desire to use cef's shared texture as Timon suggested on Discord. You can give me some ideas for more commands and options before merging

@c-mateo c-mateo marked this pull request as ready for review September 24, 2025 16:19
Copy link
Copy Markdown
Member

@timon-schelling timon-schelling left a comment

Choose a reason for hiding this comment

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

Generally good direction

Comment thread desktop/src/app.rs Outdated
tracing::info!("Opening file from command line: {}", path.display());
if let Ok(content) = std::fs::read(&path) {
let message = DesktopWrapperMessage::OpenFile { path, content };
self.dispatch_desktop_wrapper_message(message);
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.

Not a blocker but will need to be rewritten after #3247.

Copy link
Copy Markdown
Contributor Author

@c-mateo c-mateo Oct 9, 2025

Choose a reason for hiding this comment

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

I barely modified that section, just changed dispatch_desktop_wrapper_message for app_event_scheduler.schedule because calling dispatch_desktop_wrapper_message directly prevents the native open file dialog from showing up. I'm not sure if should have done something else but the cli is working.

Comment thread desktop/src/app.rs Outdated
Comment thread desktop/src/cli.rs Outdated
@timon-schelling
Copy link
Copy Markdown
Member

Looks good, I will take a closer look after the developer meetup tomorrow and probably merge. Thanks

@timon-schelling timon-schelling changed the title Add support for opening a .graphite file from a path passed as a launch argument Desktop: Add support for opening a .graphite file from a path passed as a launch argument Oct 13, 2025
Copy link
Copy Markdown
Member

@timon-schelling timon-schelling left a comment

Choose a reason for hiding this comment

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

Thanks, good work. Sorry for taking so long. :)

@timon-schelling timon-schelling merged commit 497758c into GraphiteEditor:master Oct 13, 2025
4 checks passed
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.

Allow opening a document passed as a desktop app launch argument

3 participants