Repository navigation
refactor(dloc): set a data location's root path fields in one place - #208
Draft
ehennestad wants to merge 1 commit into
Draft
ehennestad wants to merge 1 commit into
ehennestad wants to merge 1 commit into
Conversation
The fields describing the root path of a session's data location were assigned field by field in six places: expandDataLocationInfo, validateDataLocationPaths, and four methods of Session. The new static DataLocationModel.setRootPathFields does the assignment for all six. The six callers differ in what they do when a root path or data location is unknown, so each keeps its own lookup and its own handling of that case. Only the assignment is shared. Session.updateRootDir passed a logical array as the root index and stored it in RootIdx, where every other method stores a number. It now stores the number, since this is the line that changed. Adds tests for the Session methods, which had none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
ehennestad
marked this pull request as draft
November 9, 2026 07:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The fields that describe the root path of a session's data location (
RootUid,RootPath,RootIdx,Diskname) are assigned field by field in six places:expandDataLocationInfo,validateDataLocationPaths, andrefreshDataLocations,fixDataLocations,updateRootDirPathandupdateRootDirinSession. A new field or a change in how one is derived has to be made in all of them.What changes
A new static method,
DataLocationModel.setRootPathFields, copies one root path of a model item to one element of a data location struct array. All six places call it.The six are not merged into one method, because they differ in what happens when something is unknown:
expandDataLocationInfovalidateDataLocationPathsRootIdxNaN,DisknameN/ARootIdxNaN,DisknameN/ArefreshDataLocationsItemNotFoundupdateRootDirPathItemNotFoundInvalidRootPathEach keeps its lookup and that handling. Only the assignment is shared.
One behaviour changes.
updateRootDirstored a logical array inRootIdx, while every other method stores the number of the root path, and the tooltip of theDataLocationtable variable prints that value as a number. It now stores the number.SessionDataLocationFieldsTestcovers the fourSessionmethods, which had no tests.🤖 Generated with Claude Code