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

Store hasSeenReadme in project (workspace folder) data, instead of workspace data #15

Open
Ahrjen opened this issue Oct 6, 2024 · 4 comments
Labels
question Further information is requested

Comments

@Ahrjen
Copy link
Contributor

Ahrjen commented Oct 6, 2024

Currently, the hasSeenReadme is tracked for the active workspace. The active workspace can contain multiple projects (workspace folders). It might occur that a README is created later on in a project. If the project is already in the workspace, it will never be opened automatically, because the hasSeenReadme is stored on the workspace and not on the project.

Another benefit: if a project is opened individually and not from within the workspace, we know that the readme has already been viewed, so no need to show it again.

@sander1095
Copy link
Owner

I would need a couple more examples to understand this :)

@sander1095 sander1095 added the question Further information is requested label Oct 14, 2024
@Ahrjen
Copy link
Contributor Author

Ahrjen commented Oct 15, 2024

Example: You're working on a project let's say hacktoberfest.nl webapp. Frontend and backend are completely seperated, different stacks, different git repo's, different README's.

In VSCode, you can open both projects in the same window. If you do so, you'll get a new 'Workspace' (VSCode will indicate at the top of the folder bar). You can save this new workspace, with two seperate projects, in a hacktoberfest.code-workspace file.

The vscode-readme-auto-open is currently storing it's data on a workspace basis. But, if you open the hacktoberfest.nl frontend project individually, you'll get the README again, because the frontend project itself is also a 'workspace'.

  • hacktoberfest project (workspace)
    • hacktoberfest frontend project (workspace)
    • hacktoberfest backend project (workspace)
    • hacktoberfest new project (workspace)

Moreover, if a new project with readme is added to the hacktoberfest project, it will NOT open the readme, because the general hacktoberfest project has already 'hasSeenReadme' true.

@sander1095
Copy link
Owner

Thanks for the extra details!

So how do you propose we fix this, practically, if the project structure is like this:

- root
- project1
  - readme
- project2
  - readme
  • What should the plug-in do when the project is opened in the root?
  • What happens when we now open project1, will it open the readme or not?
  • What happens when a README is added to the root? Will it open it or not?

I'm curious for your perspective here! Let's try to tackle most of the edge cases.

@Ahrjen
Copy link
Contributor Author

Ahrjen commented Oct 15, 2024

The proposal of this issue is to store the hasSeenReadMe in a way that it is completely dependant on the project, and not on the workspace.

  1. To clarify root: It is a workspace, and not a project. A workspace can not have a readme.md. Therefore, only projects can have readme's. A project is a workspace however, but only if one project is active in the VSCode window.
  2. When the root (workspace containing multiple projects) is opened, every project README that has not been seen yet, is opened. OK
  3. If a project is opened individually (project1) after having been opened in root, the README is not shown. NOT-OK -> It is shown, because hasSeenReadMe is stored in (user data) root.
  4. If a project is opened individually (project1) without ever having been opened by itself or another workspace (root), the README is shown. OK
  5. If a new project3 is added to root, the README automatically opens if the project is opened for the first time, either in root or in the project3 folder. NOT-OK --> Currently only opens if project3 is opened, because root hasSeenReadMe has a state of true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants