-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Feature/keep track of active session #889
Feature/keep track of active session #889
Conversation
…ed on other properties. 2. Reactive rendering of the options form, will re-render when settings change, allowing show/hide options dynamically. 3. Added new setting to auto-save active session before switching to a different session
Fantastic! I'll try the build (By the end of next week). |
Thank you! Let me know how it goes. It's doing great for me so far :) |
@DiegoBM I built it locally and so far, seems working well 👍 😎 One question: does it also auto-save to active session when closing the window / browser? |
Thanks! It should save under the same circumstances and events than the original script was saving |
I think I just noticed a problem: I think a browser restart should reset the active session value. |
The behaviour you describe is definitely intended, it should always keep track of the current status of the browser and the active extension should always be active. In my opinion I reckon this functionality only makes sense when you have your browser configured as "continue where you left off", since otherwise it will kill the continuity of the automatic session tracking experience, if you need to re-enable your session every time that you open the browser. In any case I understand how this may affect any user that has other startup tabs setting configured, so I have included one new setting "Clear active session on Browser close" which I reckon will do what you are asking for. The setting is disabled by default so you'll need to enable it if you want to use it. Using the new settings system, the new setting will only appear if you have "Keep track of the active session" enabled. I hope it will suit your needs. |
Funny I was just coding on this too 🙈 I thought to add
else setActiveSession(null) But you point out another edge case when user configures browser to open last tabs and then doesn't set the setting in this addon. |
Not sure to follow the other edge case that you mention. You mean the new setting? |
I mean there's two ways to open last session:
Which is kind of messy already... But considering this I think it's better to use a setting like you implemented now as I think it would be complicated to cover all the edge cases correctly :/ |
Yeah, it's an "interesting" feature, but to be honest I've never used it. In any case I reckon that the default setting is "Do Nothing", so the user needs to actively configure it to open a session that way. I reckon that, at that point where the user starts messing with the settings, is the users' responsibility to configure the other settings accordingly. I reckon that the new setting properly describes the functionality and even the possible issue, in any case if it might not be clear I'm happy to change it. |
I think you misunderstand me - I totally agree with your way of doing it, given the situation. Just tried to elaborate the thoughts behind my attempt. In the meantime, here is another PR in which I added a button to unset the active tab tracking (when messing around or switching between sessions, or building a new from parts of another one - I don't want anything to be overwritten): I'm also looking to improve / streamline the UX a bit more - when to save, when to load - to be able to somehow switch between sessions smoothly... withough needing to think about it too much or loosing changes. Session and Window. 🪟
Personally, I prefer the idea of having one session per window. This also aligns with the UX concept of 'open session in new window' which would set active session to that one - but auto-save would then add other windows tabs, too. I think with the ability to auto-save towards an 'active session' the UX should to be clear around those concepts... @sienori maybe have you thought about this differentiation and have your own idea on how to tackle this? Otherwise, I'd suggest to limit auto-saving triggered by active session to one window, but... What about multi-window sessions... maybe it can track only opened windows somehow... I don't see an easy way. Anyways, I think this addon has the potential to replace Workona/Toby/Qlearly for me and some others - and having an open-source version is always much more delightful 😎 🤓 |
Reverting the relevant part of ead979c in favor of 7d25609 For reasoning see sienori#889 (comment)
I'm getting close to a version where the basics work well: Demonstration of working saving on close & switching: (I have the addon set as homepage, which will has to reload after the extension is initialised) |
I was actually agreeing with you in my previous response. We must have been lost in translation :)
The one-session-per-window topic has been discussed before regarding this PR. If you check #890 you'll find a detailed explanation of why it won't be implemented in this PR, which you already mentioned above, basically follows one of those two ideologies, but it's properly explained I hope. Also, as you mentioned, it will open a whole new can of worms with probably more complex edge cases having to track one session per window. But primarily it does not match what I consider is the definition of session. If there is need for such functionality and anyone wants to implement it as a separate feature, please feel free to reuse any parts of this PR that might be useful to you, but I'll appreciate if you can keep that as a configurable setting, since that workflow would break the way some other people (or at least myself haha) use sessions. EDIT: I forgot to mention that I totally agree that the UX should be improved if the setting is enabled. As you mentioned, in particular, with the button text, but in my case I would replace the "Open in current window" with "Open session" and use one single button, since as you mentioned, making the window distinction does not make sense anymore. |
Sorry for the very late reply! After my previous reply I got busy and stopped developing TSM. Thanks for thinking so much about TSM, @DiegoBM @tennox ! Your implementation has given me a lot of insight. There are three roles required of TSMs.
The current TSM achieves 1 and 2, but not 3. Active Session is a feature that achieves 3. Your implementation offers active sessions as an option. I have a new idea for workspace switching. Specifically, add a "Track Changes" option to the session menu and to the dialog when saving a session.
I believe this will allow integration of workspace switching into the existing TSM workflow. I close the PR. Thank you for your contribution! |
Implements:
Ability to keep track or remember the currently active session, which as a concept, it would be something similar to "the session that the user is currently working with", making sure that such session is always automatically updated instead of the user needing to manually apply the changes to that particular session.
Delayed evaluation of the "shouldShow" setting property, that now supports function calls (which will receive all the current Settings values as a function argument), and allows to compute settings' visibility based on other settings values.
Reactive rendering of the Settings form, which now will re-render when settings change, allowing to show/hide options dynamically using "shouldShow".
Added new setting that allows to auto-save the active session before switching to a different session. This new setting is only visible if the "Keep track of the active session" setting is enabled. (Note: saving might happen together with other enabled autosave options, for example, apparently when we open on current window "autoSaveWhenOpenInCurrentWindow", if the autosave when window close setting is enabled, it will also save the session).

Expanded "NameContainer" component to support two new props "forceTruncate" which truncates regardless of the truncateTitle setting, and "canRename" which dictates if the component will be able to be used to rename a session or not
Makes sourcemaps inline so that they can be used during development (they were not working, at least in Windows)
Resolves #890