{
	"issue": {
		"url": "https://api.github.com/repos/laurent22/joplin/issues/14475",
		"repository_url": "https://api.github.com/repos/laurent22/joplin",
		"labels_url": "https://api.github.com/repos/laurent22/joplin/issues/14475/labels{/name}",
		"comments_url": "https://api.github.com/repos/laurent22/joplin/issues/14475/comments",
		"events_url": "https://api.github.com/repos/laurent22/joplin/issues/14475/events",
		"html_url": "https://github.com/laurent22/joplin/pull/14475",
		"id": 3993560437,
		"node_id": "PR_kwDOBLftOs7GcJ1k",
		"number": 14475,
		"title": " Desktop: Fixes #14468: Note not moving from panel when clicked",
		"user": {
			"login": "imshubham22apr-gif",
			"id": 232333933,
			"node_id": "U_kgDODdkibQ",
			"avatar_url": "https://avatars.githubusercontent.com/u/232333933?v=4",
			"gravatar_id": "",
			"url": "https://api.github.com/users/imshubham22apr-gif",
			"html_url": "https://github.com/imshubham22apr-gif",
			"followers_url": "https://api.github.com/users/imshubham22apr-gif/followers",
			"following_url": "https://api.github.com/users/imshubham22apr-gif/following{/other_user}",
			"gists_url": "https://api.github.com/users/imshubham22apr-gif/gists{/gist_id}",
			"starred_url": "https://api.github.com/users/imshubham22apr-gif/starred{/owner}{/repo}",
			"subscriptions_url": "https://api.github.com/users/imshubham22apr-gif/subscriptions",
			"organizations_url": "https://api.github.com/users/imshubham22apr-gif/orgs",
			"repos_url": "https://api.github.com/users/imshubham22apr-gif/repos",
			"events_url": "https://api.github.com/users/imshubham22apr-gif/events{/privacy}",
			"received_events_url": "https://api.github.com/users/imshubham22apr-gif/received_events",
			"type": "User",
			"user_view_type": "public",
			"site_admin": false
		},
		"labels": [
			{
				"id": 519700741,
				"node_id": "MDU6TGFiZWw1MTk3MDA3NDE=",
				"url": "https://api.github.com/repos/laurent22/joplin/labels/bug",
				"name": "bug",
				"color": "cf353b",
				"default": true,
				"description": "It's a bug"
			},
			{
				"id": 1080341216,
				"node_id": "MDU6TGFiZWwxMDgwMzQxMjE2",
				"url": "https://api.github.com/repos/laurent22/joplin/labels/desktop",
				"name": "desktop",
				"color": "ffc274",
				"default": false,
				"description": "All desktop platforms"
			}
		],
		"state": "closed",
		"locked": false,
		"assignees": [],
		"milestone": null,
		"comments": 8,
		"created_at": "2026-02-26T06:27:12Z",
		"updated_at": "2026-03-05T08:59:13Z",
		"closed_at": "2026-03-05T08:38:14Z",
		"assignee": null,
		"author_association": "NONE",
		"active_lock_reason": null,
		"draft": false,
		"pull_request": {
			"url": "https://api.github.com/repos/laurent22/joplin/pulls/14475",
			"html_url": "https://github.com/laurent22/joplin/pull/14475",
			"diff_url": "https://github.com/laurent22/joplin/pull/14475.diff",
			"patch_url": "https://github.com/laurent22/joplin/pull/14475.patch",
			"merged_at": null
		},
		"body": "Fixes #14468\r\n\r\n## Problem\r\nWhen a note is opened in a new window and the user switches focus between windows, clicking a note in the main window's note list doesn't update the editor panel.\r\n\r\nThis happens because `NoteList2`'s [mapStateToProps](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/app-desktop/gui/NoteList/NoteList2.tsx:328:0-355:2) reads `notesParentType`, `highlightedWords`, and `parentFolderIsReadOnly` from the top-level state instead of per-window state. When `WINDOW_FOCUS` fires, the reducer's [handleFocus](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/lib/reducer.ts:959:1-978:3) swaps the WindowState properties — it copies the secondary window's properties into the top-level [state](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/lib/reducer.ts:455:0-460:1) and moves the main window's properties into `backgroundWindows`. So each NoteList2 instance ends up reading the wrong window's values, causing incorrect `parentFolderIsReadOnly` computation (which can block drag-and-drop and note interactions) and wrong `notesParentType` (which breaks `useMoveNote` behavior).\r\n\r\n## Solution\r\nRead `notesParentType`, `highlightedWords`, and `parentFolderIsReadOnly` from [windowState](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/lib/reducer.ts:415:1-423:2) (via `stateUtils.windowStateById()`) instead of the top-level [state](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/lib/reducer.ts:455:0-460:1). [windowStateById](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/lib/reducer.ts:415:1-423:2) returns [state](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/lib/reducer.ts:455:0-460:1) itself if it's the focused window, or `state.backgroundWindows[windowId]` otherwise — so each NoteList2 always reads its own window's state regardless of which window is currently focused. This is consistent with how `NoteEditor` already handles multi-window state.\r\n\r\nLow-risk change — only affects [mapStateToProps](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/app-desktop/gui/NoteList/NoteList2.tsx:328:0-355:2) in [NoteList2.tsx](cci:7://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/app-desktop/gui/NoteList/NoteList2.tsx:0:0-0:0).\r\n\r\n## Test Plan\r\n- Added a reducer test verifying that [windowStateById](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/lib/reducer.ts:415:1-423:2) returns correct per-window `notesParentType` and `selectedFolderId` after `WINDOW_FOCUS` swaps.\r\n- Manual: Open a note in a new window → switch focus between windows → verify note selection works correctly in the main window's note list.\r\n",
		"closed_by": {
			"login": "laurent22",
			"id": 1285584,
			"node_id": "MDQ6VXNlcjEyODU1ODQ=",
			"avatar_url": "https://avatars.githubusercontent.com/u/1285584?v=4",
			"gravatar_id": "",
			"url": "https://api.github.com/users/laurent22",
			"html_url": "https://github.com/laurent22",
			"followers_url": "https://api.github.com/users/laurent22/followers",
			"following_url": "https://api.github.com/users/laurent22/following{/other_user}",
			"gists_url": "https://api.github.com/users/laurent22/gists{/gist_id}",
			"starred_url": "https://api.github.com/users/laurent22/starred{/owner}{/repo}",
			"subscriptions_url": "https://api.github.com/users/laurent22/subscriptions",
			"organizations_url": "https://api.github.com/users/laurent22/orgs",
			"repos_url": "https://api.github.com/users/laurent22/repos",
			"events_url": "https://api.github.com/users/laurent22/events{/privacy}",
			"received_events_url": "https://api.github.com/users/laurent22/received_events",
			"type": "User",
			"user_view_type": "public",
			"site_admin": false
		},
		"reactions": {
			"url": "https://api.github.com/repos/laurent22/joplin/issues/14475/reactions",
			"total_count": 0,
			"+1": 0,
			"-1": 0,
			"laugh": 0,
			"hooray": 0,
			"confused": 0,
			"heart": 0,
			"rocket": 0,
			"eyes": 0
		},
		"timeline_url": "https://api.github.com/repos/laurent22/joplin/issues/14475/timeline",
		"performed_via_github_app": null,
		"state_reason": null
	},
	"comments": [
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3964393399",
			"html_url": "https://github.com/laurent22/joplin/pull/14475#issuecomment-3964393399",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/14475",
			"id": 3964393399,
			"node_id": "IC_kwDOBLftOs7sS9e3",
			"user": {
				"login": "github-actions[bot]",
				"id": 41898282,
				"node_id": "MDM6Qm90NDE4OTgyODI=",
				"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/github-actions%5Bbot%5D",
				"html_url": "https://github.com/apps/github-actions",
				"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
				"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
				"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
				"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
				"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
				"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
				"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
				"type": "Bot",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2026-02-26T06:27:26Z",
			"updated_at": "2026-03-05T08:59:13Z",
			"body": "****CLA Assistant Lite bot**** All contributors have signed the CLA  ✍️ ✅",
			"author_association": "CONTRIBUTOR",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3964393399/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": {
				"id": 15368,
				"client_id": "Iv1.05c79e9ad1f6bdfa",
				"slug": "github-actions",
				"node_id": "MDM6QXBwMTUzNjg=",
				"owner": {
					"login": "github",
					"id": 9919,
					"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
					"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
					"gravatar_id": "",
					"url": "https://api.github.com/users/github",
					"html_url": "https://github.com/github",
					"followers_url": "https://api.github.com/users/github/followers",
					"following_url": "https://api.github.com/users/github/following{/other_user}",
					"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
					"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
					"subscriptions_url": "https://api.github.com/users/github/subscriptions",
					"organizations_url": "https://api.github.com/users/github/orgs",
					"repos_url": "https://api.github.com/users/github/repos",
					"events_url": "https://api.github.com/users/github/events{/privacy}",
					"received_events_url": "https://api.github.com/users/github/received_events",
					"type": "Organization",
					"user_view_type": "public",
					"site_admin": false
				},
				"name": "GitHub Actions",
				"description": "Automate your workflow from idea to production",
				"external_url": "https://help.github.com/en/actions",
				"html_url": "https://github.com/apps/github-actions",
				"created_at": "2018-07-30T09:30:17Z",
				"updated_at": "2026-05-05T14:51:38Z",
				"permissions": {
					"actions": "write",
					"administration": "read",
					"artifact_metadata": "write",
					"attestations": "write",
					"checks": "write",
					"code_quality": "write",
					"contents": "write",
					"copilot_requests": "write",
					"deployments": "write",
					"discussions": "write",
					"issues": "write",
					"merge_queues": "write",
					"metadata": "read",
					"models": "read",
					"packages": "write",
					"pages": "write",
					"pull_requests": "write",
					"repository_hooks": "write",
					"repository_projects": "write",
					"security_events": "write",
					"statuses": "write",
					"vulnerability_alerts": "read"
				},
				"events": [
					"branch_protection_rule",
					"check_run",
					"check_suite",
					"create",
					"delete",
					"deployment",
					"deployment_status",
					"discussion",
					"discussion_comment",
					"fork",
					"gollum",
					"issues",
					"issue_comment",
					"label",
					"merge_group",
					"milestone",
					"page_build",
					"public",
					"pull_request",
					"pull_request_review",
					"pull_request_review_comment",
					"push",
					"registry_package",
					"release",
					"repository",
					"repository_dispatch",
					"status",
					"watch",
					"workflow_dispatch",
					"workflow_run"
				]
			}
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3964404713",
			"html_url": "https://github.com/laurent22/joplin/pull/14475#issuecomment-3964404713",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/14475",
			"id": 3964404713,
			"node_id": "IC_kwDOBLftOs7sTAPp",
			"user": {
				"login": "coderabbitai[bot]",
				"id": 136622811,
				"node_id": "BOT_kgDOCCSy2w",
				"avatar_url": "https://avatars.githubusercontent.com/in/347564?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/coderabbitai%5Bbot%5D",
				"html_url": "https://github.com/apps/coderabbitai",
				"followers_url": "https://api.github.com/users/coderabbitai%5Bbot%5D/followers",
				"following_url": "https://api.github.com/users/coderabbitai%5Bbot%5D/following{/other_user}",
				"gists_url": "https://api.github.com/users/coderabbitai%5Bbot%5D/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/coderabbitai%5Bbot%5D/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/coderabbitai%5Bbot%5D/subscriptions",
				"organizations_url": "https://api.github.com/users/coderabbitai%5Bbot%5D/orgs",
				"repos_url": "https://api.github.com/users/coderabbitai%5Bbot%5D/repos",
				"events_url": "https://api.github.com/users/coderabbitai%5Bbot%5D/events{/privacy}",
				"received_events_url": "https://api.github.com/users/coderabbitai%5Bbot%5D/received_events",
				"type": "Bot",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2026-02-26T06:29:28Z",
			"updated_at": "2026-03-02T05:45:05Z",
			"body": "<!-- This is an auto-generated comment: summarize by coderabbit.ai -->\nNo actionable comments were generated in the recent review. 🎉\n\n<details>\n<summary>ℹ️ Recent review info</summary>\n\n**Configuration used**: Path: .coderabbit.yaml\n\n**Review profile**: CHILL\n\n**Plan**: Pro\n\n<details>\n<summary>📥 Commits</summary>\n\nReviewing files that changed from the base of the PR and between a9ac65d5652bf2aac833a118db5e6b1ecf2e5609 and 84de4aa389a6e0721784a915830294537a37b1f5.\n\n</details>\n\n<details>\n<summary>📒 Files selected for processing (1)</summary>\n\n* `packages/lib/reducer.test.ts`\n\n</details>\n\n</details>\n\n---\n\n\n<!-- walkthrough_start -->\n\n<details>\n<summary>📝 Walkthrough</summary>\n\n## Walkthrough\n\nmapStateToProps in NoteList2 now sources folder/note context (selectedFolder, notesParentType, highlightedWords) from window-scoped state; reducer exports a new stateUtils and tests were added to verify per-window state behavior across WINDOW_FOCUS swaps.\n\n## Changes\n\n|Cohort / File(s)|Summary|\n|---|---|\n|**NoteList state mapping** <br> `packages/app-desktop/gui/NoteList/NoteList2.tsx`|mapStateToProps now derives `selectedFolder`, `notesParentType`, `selectedFolderId`, `highlightedWords`, and read-only determination from `windowState` instead of top-level state. Removed previous top-level state selections.|\n|**Reducer exports & tests** <br> `packages/lib/reducer.ts`, `packages/lib/reducer.test.ts`|Added and re-exported `stateUtils` from the reducer module; introduced tests validating per-window state via `windowStateById` across `WINDOW_OPEN`/`WINDOW_FOCUS` swaps.|\n\n## Suggested labels\n\n`desktop`, `bug`\n\n</details>\n\n<!-- walkthrough_end -->\n\n\n<!-- pre_merge_checks_walkthrough_start -->\n\n---\n\n<!-- pre_merge_checks_override_start -->\n> [!IMPORTANT]\n> ## Pre-merge checks failed\n> \n> Please resolve all errors before merging. Addressing warnings is optional.\n<!-- pre_merge_checks_override_end -->\n\n### ❌ Failed checks (1 error)\n\n|               Check name              | Status  | Explanation                                                                                                                                              | Resolution                                                                                                                                                                          |\n| :-----------------------------------: | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Pr Description Must Follow Guidelines | ❌ Error | PR description lacks explicit Test Plan or verification steps section required by custom check guidelines, despite tests being added to reducer.test.ts. | Add dedicated Test Plan section documenting new test for per-window state isolation, test scenarios covered (WINDOW_OPEN, WINDOW_FOCUS transitions), and manual verification steps. |\n\n<details>\n<summary>✅ Passed checks (5 passed)</summary>\n\n|         Check name         | Status   | Explanation                                                                                                                                                                     |\n| :------------------------: | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n|         Title check        | ✅ Passed | The title accurately references the specific issue (`#14468`) and describes the main fix: ensuring notes move/appear in the panel when clicked.                                   |\n|      Description check     | ✅ Passed | The description is directly related to the changeset, explaining the root cause (reading from wrong state) and the fix (reading from windowState).                              |\n|     Linked Issues check    | ✅ Passed | The changes address the core requirement from `#14468`: fixing note selection in the editor panel by ensuring per-window state isolation via windowState instead of global state. |\n| Out of Scope Changes check | ✅ Passed | The changes are within scope: NoteList2.tsx mapStateToProps modifications and reducer test additions directly support fixing `#14468`'s note-switching issue.                     |\n|     Docstring Coverage     | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.                                                                      |\n\n</details>\n\n<!-- pre_merge_checks_walkthrough_end -->\n\n<!-- finishing_touch_checkbox_start -->\n\n<details>\n<summary>✨ Finishing Touches</summary>\n\n<details>\n<summary>🧪 Generate unit tests (beta)</summary>\n\n- [ ] <!-- {\"checkboxId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Create PR with unit tests\n- [ ] <!-- {\"checkboxId\": \"07f1e7d6-8a8e-4e23-9900-8731c2c87f58\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Post copyable unit tests in a comment\n\n</details>\n\n</details>\n\n<!-- finishing_touch_checkbox_end -->\n\n<!-- tips_start -->\n\n---\n\nThanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=laurent22/joplin&utm_content=14475)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.\n\n<details>\n<summary>❤️ Share</summary>\n\n- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)\n- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)\n- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)\n- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)\n\n</details>\n\n<sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub>\n\n<!-- tips_end -->\n\n<!-- internal state start -->\n\n\n<!-- [encoded data, 6340 characters] -->\n\n<!-- internal state end -->",
			"author_association": "CONTRIBUTOR",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3964404713/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": {
				"id": 347564,
				"client_id": "Iv1.6aaafe4fe882736b",
				"slug": "coderabbitai",
				"node_id": "A_kwHOB96YWc4ABU2s",
				"owner": {
					"login": "coderabbitai",
					"id": 132028505,
					"node_id": "O_kgDOB96YWQ",
					"avatar_url": "https://avatars.githubusercontent.com/u/132028505?v=4",
					"gravatar_id": "",
					"url": "https://api.github.com/users/coderabbitai",
					"html_url": "https://github.com/coderabbitai",
					"followers_url": "https://api.github.com/users/coderabbitai/followers",
					"following_url": "https://api.github.com/users/coderabbitai/following{/other_user}",
					"gists_url": "https://api.github.com/users/coderabbitai/gists{/gist_id}",
					"starred_url": "https://api.github.com/users/coderabbitai/starred{/owner}{/repo}",
					"subscriptions_url": "https://api.github.com/users/coderabbitai/subscriptions",
					"organizations_url": "https://api.github.com/users/coderabbitai/orgs",
					"repos_url": "https://api.github.com/users/coderabbitai/repos",
					"events_url": "https://api.github.com/users/coderabbitai/events{/privacy}",
					"received_events_url": "https://api.github.com/users/coderabbitai/received_events",
					"type": "Organization",
					"user_view_type": "public",
					"site_admin": false
				},
				"name": "coderabbitai",
				"description": "# Transforming Code Reviews with AI\r\n\r\n## Features\r\n\r\n**Automated Reviews**: Continuous reviews of the pull requests including incremental commits. \r\n\r\n**Summarization**: Generates high-level summary and a technical walkthrough of the PR changes. \r\n\r\n**Line-by-line review**: Provides line-by-line suggestions committable with one click.\r\n\r\n**Codebase verification**:  Verifies the impact on the overall codebase and identifies missing changes.\r\n\r\n**Insights into your code**:  Ask any questions on your codebase within the pull request \r\n\r\n**Chat about your code** : Chat with the bot around your code. The more you chat, the smarter it gets.\r\n\r\n**Issue Validation**:  Validates the PR against the linked issues and identifies other related issues \r\n\r\n\r\n\r\n",
				"external_url": "https://coderabbit.ai?utm_source=cr_app&utm_medium=github",
				"html_url": "https://github.com/apps/coderabbitai",
				"created_at": "2023-06-14T15:47:27Z",
				"updated_at": "2026-03-14T07:58:44Z",
				"permissions": {
					"actions": "read",
					"checks": "write",
					"contents": "write",
					"discussions": "read",
					"issues": "write",
					"members": "read",
					"metadata": "read",
					"pull_requests": "write",
					"statuses": "write"
				},
				"events": [
					"issues",
					"issue_comment",
					"label",
					"organization",
					"pull_request",
					"pull_request_review",
					"pull_request_review_comment",
					"pull_request_review_thread",
					"release",
					"repository"
				]
			}
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3964584461",
			"html_url": "https://github.com/laurent22/joplin/pull/14475#issuecomment-3964584461",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/14475",
			"id": 3964584461,
			"node_id": "IC_kwDOBLftOs7sTsIN",
			"user": {
				"login": "imshubham22apr-gif",
				"id": 232333933,
				"node_id": "U_kgDODdkibQ",
				"avatar_url": "https://avatars.githubusercontent.com/u/232333933?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/imshubham22apr-gif",
				"html_url": "https://github.com/imshubham22apr-gif",
				"followers_url": "https://api.github.com/users/imshubham22apr-gif/followers",
				"following_url": "https://api.github.com/users/imshubham22apr-gif/following{/other_user}",
				"gists_url": "https://api.github.com/users/imshubham22apr-gif/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/imshubham22apr-gif/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/imshubham22apr-gif/subscriptions",
				"organizations_url": "https://api.github.com/users/imshubham22apr-gif/orgs",
				"repos_url": "https://api.github.com/users/imshubham22apr-gif/repos",
				"events_url": "https://api.github.com/users/imshubham22apr-gif/events{/privacy}",
				"received_events_url": "https://api.github.com/users/imshubham22apr-gif/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2026-02-26T07:14:41Z",
			"updated_at": "2026-02-26T07:14:41Z",
			"body": "I have read the CLA Document and I hereby sign the CLA",
			"author_association": "NONE",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3964584461/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3967016296",
			"html_url": "https://github.com/laurent22/joplin/pull/14475#issuecomment-3967016296",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/14475",
			"id": 3967016296,
			"node_id": "IC_kwDOBLftOs7sc91o",
			"user": {
				"login": "personalizedrefrigerator",
				"id": 46334387,
				"node_id": "MDQ6VXNlcjQ2MzM0Mzg3",
				"avatar_url": "https://avatars.githubusercontent.com/u/46334387?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/personalizedrefrigerator",
				"html_url": "https://github.com/personalizedrefrigerator",
				"followers_url": "https://api.github.com/users/personalizedrefrigerator/followers",
				"following_url": "https://api.github.com/users/personalizedrefrigerator/following{/other_user}",
				"gists_url": "https://api.github.com/users/personalizedrefrigerator/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/personalizedrefrigerator/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/personalizedrefrigerator/subscriptions",
				"organizations_url": "https://api.github.com/users/personalizedrefrigerator/orgs",
				"repos_url": "https://api.github.com/users/personalizedrefrigerator/repos",
				"events_url": "https://api.github.com/users/personalizedrefrigerator/events{/privacy}",
				"received_events_url": "https://api.github.com/users/personalizedrefrigerator/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2026-02-26T14:32:04Z",
			"updated_at": "2026-02-26T18:22:23Z",
			"body": "Thank you for the pull request! For correctness, this change looks good to me.\r\n\r\n> This is a problem because when you open a note in a new window and switch focus, WINDOW_FOCUS swaps the window states around — so state.notesParentType ends up pointing to the wrong window's value.\r\n\r\nA more in-depth explanation for how this fixes #14468 would be appreciated! How do incorrect values for `notesParentType` and `parentFolderIsReadOnly` break switching notes?  When the user switches back to the main window, `notesParentType`, `parentFolderIsReadOnly`, etc. should update to match the note list's content. In what cases are `notesParentType` and `parentFolderIsReadOnly` still incorrect such that #14468 can happen?\r\n\r\n(**Edit**: If this pull request is related to GSoC, please also [follow the GSoC pull request guidelines](https://github.com/joplin/gsoc/blob/master/pull_request_guidelines.md)).",
			"author_association": "COLLABORATOR",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3967016296/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3979844258",
			"html_url": "https://github.com/laurent22/joplin/pull/14475#issuecomment-3979844258",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/14475",
			"id": 3979844258,
			"node_id": "IC_kwDOBLftOs7tN5qi",
			"user": {
				"login": "laurent22",
				"id": 1285584,
				"node_id": "MDQ6VXNlcjEyODU1ODQ=",
				"avatar_url": "https://avatars.githubusercontent.com/u/1285584?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/laurent22",
				"html_url": "https://github.com/laurent22",
				"followers_url": "https://api.github.com/users/laurent22/followers",
				"following_url": "https://api.github.com/users/laurent22/following{/other_user}",
				"gists_url": "https://api.github.com/users/laurent22/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/laurent22/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/laurent22/subscriptions",
				"organizations_url": "https://api.github.com/users/laurent22/orgs",
				"repos_url": "https://api.github.com/users/laurent22/repos",
				"events_url": "https://api.github.com/users/laurent22/events{/privacy}",
				"received_events_url": "https://api.github.com/users/laurent22/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2026-03-01T12:10:16Z",
			"updated_at": "2026-03-01T12:10:16Z",
			"body": "@imshubham22apr-gif, please confirm you are ok with completing this PR",
			"author_association": "OWNER",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3979844258/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3982285008",
			"html_url": "https://github.com/laurent22/joplin/pull/14475#issuecomment-3982285008",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/14475",
			"id": 3982285008,
			"node_id": "IC_kwDOBLftOs7tXNjQ",
			"user": {
				"login": "imshubham22apr-gif",
				"id": 232333933,
				"node_id": "U_kgDODdkibQ",
				"avatar_url": "https://avatars.githubusercontent.com/u/232333933?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/imshubham22apr-gif",
				"html_url": "https://github.com/imshubham22apr-gif",
				"followers_url": "https://api.github.com/users/imshubham22apr-gif/followers",
				"following_url": "https://api.github.com/users/imshubham22apr-gif/following{/other_user}",
				"gists_url": "https://api.github.com/users/imshubham22apr-gif/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/imshubham22apr-gif/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/imshubham22apr-gif/subscriptions",
				"organizations_url": "https://api.github.com/users/imshubham22apr-gif/orgs",
				"repos_url": "https://api.github.com/users/imshubham22apr-gif/repos",
				"events_url": "https://api.github.com/users/imshubham22apr-gif/events{/privacy}",
				"received_events_url": "https://api.github.com/users/imshubham22apr-gif/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2026-03-02T05:51:22Z",
			"updated_at": "2026-03-02T05:51:22Z",
			"body": "@laurent22 Yes, I'm completing this PR. I've added a test unit and updated the description with a detailed explanation.\r\n\r\n@personalizedrefrigerator Thanks for the review! Here's a more in-depth explanation:\r\n\r\n**How `WINDOW_FOCUS` breaks things:** When a secondary window gains focus, the reducer's [handleFocus](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/lib/reducer.ts:959:1-978:3) (reducer.ts ~line 960) **swaps** the WindowState properties — it copies the secondary window's properties into the top-level [state](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/lib/reducer.ts:455:0-460:1) and moves the main window's properties into `backgroundWindows`.\r\n\r\n**The bug:** Before this fix, `NoteList2`'s [mapStateToProps](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/app-desktop/gui/NoteList/NoteList2.tsx:328:0-355:2) was reading `notesParentType`, `highlightedWords`, and `parentFolderIsReadOnly` directly from `state.*` (top-level). Since each window has its own `NoteList2` instance, when the secondary window gained focus, the main window's NoteList would re-render with the **secondary window's** `notesParentType` and `selectedFolderId`.\r\n\r\nThis causes `parentFolderIsReadOnly` to be computed from the wrong folder (the secondary window's folder instead of the main window's). If this evaluates to `true` incorrectly, the drag-and-drop handler (`useDragAndDrop`) blocks interactions. Similarly, the wrong `notesParentType` can cause `useMoveNote` to behave incorrectly.\r\n\r\n**Why [windowStateById](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/lib/reducer.ts:415:1-423:2) fixes it:** `stateUtils.windowStateById(state, windowId)` returns [state](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/lib/reducer.ts:455:0-460:1) itself if it's the focused window, or `state.backgroundWindows[windowId]` otherwise. So each NoteList2 always reads its **own** window's state, regardless of which window is currently focused. This matches how `NoteEditor` already handles it.\r\n\r\nI've also added a test in the latest commit that verifies [windowStateById](cci:1://file:///c:/Users/dhara/Documents/Aashish/vscode/joplin/packages/lib/reducer.ts:415:1-423:2) returns correct per-window state after `WINDOW_FOCUS` swaps.\r\n",
			"author_association": "NONE",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3982285008/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3985650367",
			"html_url": "https://github.com/laurent22/joplin/pull/14475#issuecomment-3985650367",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/14475",
			"id": 3985650367,
			"node_id": "IC_kwDOBLftOs7tkDK_",
			"user": {
				"login": "personalizedrefrigerator",
				"id": 46334387,
				"node_id": "MDQ6VXNlcjQ2MzM0Mzg3",
				"avatar_url": "https://avatars.githubusercontent.com/u/46334387?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/personalizedrefrigerator",
				"html_url": "https://github.com/personalizedrefrigerator",
				"followers_url": "https://api.github.com/users/personalizedrefrigerator/followers",
				"following_url": "https://api.github.com/users/personalizedrefrigerator/following{/other_user}",
				"gists_url": "https://api.github.com/users/personalizedrefrigerator/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/personalizedrefrigerator/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/personalizedrefrigerator/subscriptions",
				"organizations_url": "https://api.github.com/users/personalizedrefrigerator/orgs",
				"repos_url": "https://api.github.com/users/personalizedrefrigerator/repos",
				"events_url": "https://api.github.com/users/personalizedrefrigerator/events{/privacy}",
				"received_events_url": "https://api.github.com/users/personalizedrefrigerator/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2026-03-02T17:04:32Z",
			"updated_at": "2026-03-02T17:04:32Z",
			"body": "Thank you for the additional explanation! I'm still not convinced that this change is related to https://github.com/laurent22/joplin/issues/14468.\r\n\r\n> This causes parentFolderIsReadOnly to be computed from the wrong folder (the secondary window's folder instead of the main window's). If this evaluates to true incorrectly, the drag-and-drop handler (useDragAndDrop) blocks interactions. Similarly, the wrong notesParentType can cause useMoveNote to behave incorrectly.\r\n\r\nLocally, even if I hardcode `parentFolderIsReadOnly` to `true`, I'm still able to switch between notes in the note viewer/editor pane (however drag-and-drop in the notes list doesn't work). As such, I don't think `parentFolderIsReadOnly` is related to https://github.com/laurent22/joplin/issues/14468.\r\n",
			"author_association": "COLLABORATOR",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/3985650367/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/4003319494",
			"html_url": "https://github.com/laurent22/joplin/pull/14475#issuecomment-4003319494",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/14475",
			"id": 4003319494,
			"node_id": "IC_kwDOBLftOs7unc7G",
			"user": {
				"login": "laurent22",
				"id": 1285584,
				"node_id": "MDQ6VXNlcjEyODU1ODQ=",
				"avatar_url": "https://avatars.githubusercontent.com/u/1285584?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/laurent22",
				"html_url": "https://github.com/laurent22",
				"followers_url": "https://api.github.com/users/laurent22/followers",
				"following_url": "https://api.github.com/users/laurent22/following{/other_user}",
				"gists_url": "https://api.github.com/users/laurent22/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/laurent22/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/laurent22/subscriptions",
				"organizations_url": "https://api.github.com/users/laurent22/orgs",
				"repos_url": "https://api.github.com/users/laurent22/repos",
				"events_url": "https://api.github.com/users/laurent22/events{/privacy}",
				"received_events_url": "https://api.github.com/users/laurent22/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2026-03-05T08:38:14Z",
			"updated_at": "2026-03-05T08:38:14Z",
			"body": "Hello, since this pull request does not appear to be active, we are closing it to keep the PR backlog manageable. If you decide to continue working on it later, just let us know when it’s ready for review and we can reopen it.",
			"author_association": "OWNER",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/4003319494/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		}
	]
}