-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
fix #106487 implement 'enablement' clause for viewsWelcome contribution's buttons #107705
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure the space reservation makes sense. Apart from the fact that the final message is taller than the loading one, making the button shift down, it doesn't feel like it's very useful to have a Learn More
button there. I would simply remove it.
After seeing it live, I am getting second thoughts about this. How about we provide a way to declare a disabled button instead? And possibly have a tooltip which would describe why the button is disabled when hovered? That way we can have 100% the same contents thus causing no jumping at all and avoid having a strange |
I was just investigating that possibility. The viewsWelcome contribution mechanism almost lets me achieve this. There's an optional |
Yeah it currently doesn't support |
Wait.. we already support it?! Or you just hacked it for now? YES looks much much better. |
I've pushed the changes that make this work. |
As you may know, new API additions require an |
Sorry @gjsjohnmurray, closing this as per #106487 Changes will still be here as a reference in case we decide to go back to it. |
@joaomoreno ironically I was just blowing the dust of this and about to get back to you for help with steering the API change through the required process. The only additions needed are in viewsWelcomeContribution.ts and viewsWelcomeExtensionPoint.ts, plus a bugfix in viewPaneContainer.ts. So having read in the Extension API Process doc the following:
I'm not clear how to proceed. I don't need anything changed in vscode.d.ts or in its precursor vscode.proposed.d.ts Please advise. |
I'm just wondering if this will really be worth the effort. I'm not entirely sold on the amount of work/extra code here vs. the added benefits. |
I think it's worthwhile. The current experience of our extension's viewsWelcome contribution suddenly jumping down the screen because the Git extension has just completed its init is somewhat jarring. And the more extensions adopt viewsWelcome the more I foresee this kind of thing happening. The changes I propose (which really aren't extensive) provide extension developers a way of being better citizens in the shared space. |
@jrieken What do you think? |
In pictures, here's current behaviour, where my extension contributes text and a button which subsequently gets bumped down when the git extension finishes initializing: And proposed, after the git extension has been tweaked to use the new capability: (ignore the extra text in the contribution from my extension, which was added between capture of the "before" case and the "after" case) |
I like the feature/enhancement, but I think the proposed changed to the contribution need some polish, I'd suggest |
Alright, let's make those changes here. |
@jrieken fair point, but the advantage of the vscode/extensions/git/package.nls.json Line 180 in ceeb974
My
In this particular case it's right that both buttons enable/disable in lockstep, but there could be situations where each button needs a different clause. If you're unconvinced then I'll implement |
I'd say that's wanted since this contribution point talks about about welcome views. Spreading information about enablement of commands inside it into the contribution seems too loose. So, I'd day that the enablement-properties applies to the whole welcome-view thing. However, if we believe that fine grained enablement of individual command is needed then I would invest in a syntax that allows that to be expressed together with the command. That would keep information together and also not pose challenges about keeping the ordering correct - think about NLS and a translator reordering sentences/commands. |
@jrieken thanks for your feedback. I have pushed the changes to make this work off an @joaomoreno I think this is ready to merge. |
Thanks! 🍻 |
UPDATE: The actual solution reached during discussion in this PR can be seen in this comment
This PR fixes #106487 by adding an "activating" message as suggested by @joaomoreno
I included the "Learn More" button as a way of reserving the space that gets occupied by the "Clone Repository" button as soon as the git extension completes activation:
"Learn More" leads to the same place as the "read our docs" link in the second screenshot.