Skip to content

Unsync source column count - #8143

Merged
jmcphers merged 1 commit into
masterfrom
bugfix/column-sync
Oct 22, 2020
Merged

jmcphers merged 1 commit into
masterfrom
bugfix/column-sync

Conversation

@melissa-barca

Copy link
Copy Markdown
Contributor

Intent

Closes #8107

Adding or removing a column should not affect other instances of RStudio the user is running. Previously any changes made to the additional_column_count in global-prefs.json were made immediately, but now changes are only made on startup and when the IDE is writing to the preference file. This allows the column state to be saved between sessions, while preventing columns being added/removed in an active session without user prompt.

Approach

I removed the panes user preference handler that was syncing the two instances. Now the column count is only updated when requested by the user in that session.

QA Notes

If the user ends a session with three columns, their next session should start with three columns. However, when running two instances of RStudio, the column counts should not be in sync.

Original ticket has good repo notes.

@melissa-barca

Copy link
Copy Markdown
Contributor Author

@jmcphers & @gtritchie What do you think of this approach?

With this, the last RStudio instance that writes to the file will have their column state restored. This could lead to weirdness if a change is made to the layout in one session that is then closed while the user continues to work in another session, but I'm not sure if that is something we need to worry about.

@jmcphers

Copy link
Copy Markdown
Member

There are a few other instances of this kind of awkward "last one wins" behavior when you have multiple RStudio sessions. It is more pronounced here because source panes sit in an uncomfortable zone between a global user pref and session-specific UI. But in general the "last session wins" behavior is just fine as there isn't anything more reasonable to do that would make sense for this release.

The only thing I'd be concerned about here is that different parts of the IDE may now have different ideas about how many additional columns there are. This change keeps the columns from actually appearing, but any code that will inspect the pref is going to pick up a number that might differ from reality, even after this change. Is that okay? Is access to that value generally encapsulated in this class?

@melissa-barca

Copy link
Copy Markdown
Contributor Author

@jmcphers that's correct. In other scenarios where we care about the number of columns we get the size from SourceColumnManager.

@melissa-barca melissa-barca added this to the v1.4 milestone Oct 21, 2020
@melissa-barca
melissa-barca marked this pull request as ready for review October 21, 2020 21:48

@gtritchie gtritchie left a comment

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.

LGTM!

@jmcphers
jmcphers merged commit 61a27e4 into master Oct 22, 2020
@melissa-barca
melissa-barca deleted the bugfix/column-sync branch January 21, 2022 17:10
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.

Source column layout should be independent between RStudio instances

3 participants