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

Add an endpoint to initialize the GUI #109

Closed
wants to merge 1 commit into from
Closed

Conversation

brianhelba
Copy link
Collaborator

@brianhelba brianhelba commented May 16, 2023

This should improve how we handle default directories on Windows. It also provides a better separation of concerns (GUI initialization vs actual directory selection), which should make future development and testing easier.

Fixes #59.

# On Linux, this should typically resolve to "/"
root_directory = Path.cwd().root

# TODO: FastAPI has a bug where a URL object can't be directly returned here
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@brianhelba TODO: report this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm going to file local and upstream issues, then delete this code comment.

@brianhelba brianhelba force-pushed the home-endpoint branch 2 times, most recently from 41c5ac5 to bef41c2 Compare May 16, 2023 16:25
Base automatically changed from test-name to main May 16, 2023 18:33
@brianhelba brianhelba requested a review from marySalvi May 16, 2023 18:55
@brianhelba brianhelba marked this pull request as ready for review May 16, 2023 18:55
def test_gui_select_directory(client: TestClient) -> None:
response = client.get("/")
def test_gui_home(client: TestClient) -> None:
response = client.get(app.url_path_for("home"), follow_redirects=True)

assert response.status_code == 200
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we could put some more specific assertions in here, to ensure it really is the root that's being redirected to. I believe that was the problem raised in #59.

@brianhelba
Copy link
Collaborator Author

@marySalvi Beyond the two issues I've self-identified, can you review this and let me know if it's a reasonable approach?

Copy link
Collaborator

@marySalvi marySalvi left a comment

Choose a reason for hiding this comment

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

LGTM

@naglepuff
Copy link
Collaborator

@marySalvi @brianhelba what is the status of this PR? Can it be closed?

@manthey
Copy link
Contributor

manthey commented Jun 25, 2024

This doesn't seem necessary with the current behavior on Windows. We can reopen it if we decide it is needed.

@manthey manthey closed this Jun 25, 2024
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.

Examine the handling of root directory selection in the GUI on Windows
4 participants