Skip to content

Commit 54941e9

Browse files
committed
feat(web): rename sidebar project lists and collapse chat for shared non-owners
Workspace home left rail now labels personal vs team project lists ("Personal projects" / "Team projects", 个人项目 / 团队项目) across all locales. Opening a confirmed shared team project that the viewer did not create defaults the chat pane to collapsed so the design is primary; owners and personal projects keep chat open, and expanding chat stays sticky for the visit.
1 parent a5715da commit 54941e9

21 files changed

Lines changed: 207 additions & 113 deletions

File tree

apps/web/src/components/ProjectView.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,6 +1186,24 @@ export function projectSplitClassName(workspaceFocused: boolean): string {
11861186
return workspaceFocused ? 'split split-focus' : 'split';
11871187
}
11881188

1189+
/**
1190+
* Whether a project open should start with the chat pane collapsed (workspace
1191+
* focus mode). Shared team projects the viewer did not create — confirmed
1192+
* shared (`syncState` past `local_only`) and not owned by the viewer — default
1193+
* to design-first so members land on the artifact instead of the author's
1194+
* conversation. Personal projects, owners, and still-unknown collab status
1195+
* keep chat open (the usual default).
1196+
*/
1197+
export function shouldDefaultCollapseChatForSharedNonOwner(collab: {
1198+
enabled: boolean;
1199+
syncState: string | null;
1200+
isOwner: boolean;
1201+
}): boolean {
1202+
if (!collab.enabled) return false;
1203+
if (collab.syncState == null || collab.syncState === 'local_only') return false;
1204+
return !collab.isOwner;
1205+
}
1206+
11891207
// React key for the on-screen question form. Deliberately does NOT include the
11901208
// form's parsed `id`: there is at most one (first) form per assistant message,
11911209
// so `${conversation}:${message}` is already a stable, unique identity for the
@@ -2282,10 +2300,30 @@ export function ProjectView({
22822300
setActiveConversationId(routeConversationId);
22832301
}, [routeConversationId, conversations, activeConversationId]);
22842302

2303+
// Reset chat pane to the open default on project switch. Shared non-owner
2304+
// projects re-collapse once collab status confirms (see below) — but only
2305+
// once per open, so expanding chat after that is sticky for the visit.
2306+
const sharedNonOwnerChatDefaultAppliedRef = useRef<string | null>(null);
22852307
useEffect(() => {
22862308
setWorkspaceFocused(false);
2309+
sharedNonOwnerChatDefaultAppliedRef.current = null;
22872310
}, [project.id]);
22882311

2312+
useEffect(() => {
2313+
if (sharedNonOwnerChatDefaultAppliedRef.current === project.id) return;
2314+
if (
2315+
!shouldDefaultCollapseChatForSharedNonOwner({
2316+
enabled: projectCollab.enabled,
2317+
syncState: projectCollab.syncState,
2318+
isOwner: projectCollab.isOwner,
2319+
})
2320+
) {
2321+
return;
2322+
}
2323+
setWorkspaceFocused(true);
2324+
sharedNonOwnerChatDefaultAppliedRef.current = project.id;
2325+
}, [project.id, projectCollab.enabled, projectCollab.syncState, projectCollab.isOwner]);
2326+
22892327
// Load messages whenever the active conversation changes. This happens
22902328
// on project mount (after conversations load) and on user-triggered
22912329
// conversation switches.

apps/web/src/i18n/locales/ar.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const ar: Dict = {
5252
"workspaceInvite.removeRow": "Remove",
5353
"workspaceInvite.addMember": "Add member",
5454
"workspaceInvite.visibilityQuestion": "Will team members see my designs?",
55-
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Drafts are not visible to others.",
55+
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Personal projects are not visible to others.",
5656
"workspaceInvite.sent": "Invitation sent",
5757
"workspaceInvite.sending": "Inviting…",
5858
"workspaceInvite.confirm": "Confirm and invite",
@@ -757,8 +757,8 @@ export const ar: Dict = {
757757
'workspaceSwitcher.team': 'Team',
758758
'workspaceSwitcher.invite': 'Invite colleague',
759759
'workspaceSwitcher.createTeam': 'New team',
760-
"workspaceSwitcher.draftsTooltip": "Drafts",
761-
"workspaceSwitcher.allProjectsTooltip": "All projects",
760+
"workspaceSwitcher.draftsTooltip": "المشاريع الشخصية",
761+
"workspaceSwitcher.allProjectsTooltip": "مشاريع الفريق",
762762
"entry.primaryNavAria": "Primary",
763763
"entry.billingTierTeam": "Teams",
764764
"entry.billingTierFree": "Free",
@@ -842,8 +842,8 @@ export const ar: Dict = {
842842
'entry.navIntegrations': 'عمليات الدمج',
843843
'entry.navMembers': 'Members',
844844
'entry.navWorkspaceSettings': 'Workspace settings',
845-
'entry.navDrafts': 'Drafts',
846-
'entry.navAllProjects': 'All projects',
845+
'entry.navDrafts': 'المشاريع الشخصية',
846+
'entry.navAllProjects': 'مشاريع الفريق',
847847
'entry.draftsDescription': 'Projects you created, visible only to you',
848848
'entry.allProjectsDescription': 'Projects owned by everyone on the team',
849849
'entry.navBoard': 'Board',
@@ -1104,7 +1104,7 @@ export const ar: Dict = {
11041104
'recentProjects.moveToTeam': 'Move to team space',
11051105
'recentProjects.moveToTeamDescPre': 'Once moved to the team space, ',
11061106
'recentProjects.moveToTeamDescStrong': 'all team members can view and comment',
1107-
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "All projects".',
1107+
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "Team projects".',
11081108
'recentProjects.moveToPersonalDescPre': 'Once moved out of the team space, it returns to a personal project, ',
11091109
'recentProjects.moveToPersonalDescStrong': 'only you can view and edit it',
11101110
'recentProjects.moveToPersonalDescPost': '.',

apps/web/src/i18n/locales/de.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const de: Dict = {
5252
"workspaceInvite.removeRow": "Remove",
5353
"workspaceInvite.addMember": "Add member",
5454
"workspaceInvite.visibilityQuestion": "Will team members see my designs?",
55-
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Drafts are not visible to others.",
55+
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Personal projects are not visible to others.",
5656
"workspaceInvite.sent": "Invitation sent",
5757
"workspaceInvite.sending": "Inviting…",
5858
"workspaceInvite.confirm": "Confirm and invite",
@@ -757,8 +757,8 @@ export const de: Dict = {
757757
'workspaceSwitcher.team': 'Team',
758758
'workspaceSwitcher.invite': 'Invite colleague',
759759
'workspaceSwitcher.createTeam': 'New team',
760-
"workspaceSwitcher.draftsTooltip": "Drafts",
761-
"workspaceSwitcher.allProjectsTooltip": "All projects",
760+
"workspaceSwitcher.draftsTooltip": "Persönliche Projekte",
761+
"workspaceSwitcher.allProjectsTooltip": "Teamprojekte",
762762
"entry.primaryNavAria": "Primary",
763763
"entry.billingTierTeam": "Teams",
764764
"entry.billingTierFree": "Free",
@@ -842,8 +842,8 @@ export const de: Dict = {
842842
'entry.navIntegrations': 'Integrationen',
843843
'entry.navMembers': 'Members',
844844
'entry.navWorkspaceSettings': 'Workspace settings',
845-
'entry.navDrafts': 'Drafts',
846-
'entry.navAllProjects': 'All projects',
845+
'entry.navDrafts': 'Persönliche Projekte',
846+
'entry.navAllProjects': 'Teamprojekte',
847847
'entry.draftsDescription': 'Projects you created, visible only to you',
848848
'entry.allProjectsDescription': 'Projects owned by everyone on the team',
849849
'entry.navBoard': 'Board',
@@ -1104,7 +1104,7 @@ export const de: Dict = {
11041104
'recentProjects.moveToTeam': 'Move to team space',
11051105
'recentProjects.moveToTeamDescPre': 'Once moved to the team space, ',
11061106
'recentProjects.moveToTeamDescStrong': 'all team members can view and comment',
1107-
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "All projects".',
1107+
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "Team projects".',
11081108
'recentProjects.moveToPersonalDescPre': 'Once moved out of the team space, it returns to a personal project, ',
11091109
'recentProjects.moveToPersonalDescStrong': 'only you can view and edit it',
11101110
'recentProjects.moveToPersonalDescPost': '.',

apps/web/src/i18n/locales/en.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const en: Dict = {
5252
"workspaceInvite.removeRow": "Remove",
5353
"workspaceInvite.addMember": "Add member",
5454
"workspaceInvite.visibilityQuestion": "Will team members see my designs?",
55-
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Drafts are not visible to others.",
55+
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Personal projects are not visible to others.",
5656
"workspaceInvite.sent": "Invitation sent",
5757
"workspaceInvite.sending": "Inviting…",
5858
"workspaceInvite.confirm": "Confirm and invite",
@@ -757,8 +757,8 @@ export const en: Dict = {
757757
'workspaceSwitcher.team': 'Team',
758758
'workspaceSwitcher.invite': 'Invite colleague',
759759
'workspaceSwitcher.createTeam': 'New team',
760-
"workspaceSwitcher.draftsTooltip": "Drafts",
761-
"workspaceSwitcher.allProjectsTooltip": "All projects",
760+
"workspaceSwitcher.draftsTooltip": "Personal projects",
761+
"workspaceSwitcher.allProjectsTooltip": "Team projects",
762762
"entry.primaryNavAria": "Primary",
763763
"entry.billingTierTeam": "Teams",
764764
"entry.billingTierFree": "Free",
@@ -842,8 +842,8 @@ export const en: Dict = {
842842
'entry.navIntegrations': 'Integrations',
843843
'entry.navMembers': 'Members',
844844
'entry.navWorkspaceSettings': 'Workspace settings',
845-
'entry.navDrafts': 'Drafts',
846-
'entry.navAllProjects': 'All projects',
845+
'entry.navDrafts': 'Personal projects',
846+
'entry.navAllProjects': 'Team projects',
847847
'entry.draftsDescription': 'Projects you created, visible only to you',
848848
'entry.allProjectsDescription': 'Projects owned by everyone on the team',
849849
'entry.navBoard': 'Board',
@@ -1104,7 +1104,7 @@ export const en: Dict = {
11041104
'recentProjects.moveToTeam': 'Move to team space',
11051105
'recentProjects.moveToTeamDescPre': 'Once moved to the team space, ',
11061106
'recentProjects.moveToTeamDescStrong': 'all team members can view and comment',
1107-
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "All projects".',
1107+
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "Team projects".',
11081108
'recentProjects.moveToPersonalDescPre': 'Once moved out of the team space, it returns to a personal project, ',
11091109
'recentProjects.moveToPersonalDescStrong': 'only you can view and edit it',
11101110
'recentProjects.moveToPersonalDescPost': '.',

apps/web/src/i18n/locales/es-ES.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const esES: Dict = {
5252
"workspaceInvite.removeRow": "Remove",
5353
"workspaceInvite.addMember": "Add member",
5454
"workspaceInvite.visibilityQuestion": "Will team members see my designs?",
55-
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Drafts are not visible to others.",
55+
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Personal projects are not visible to others.",
5656
"workspaceInvite.sent": "Invitation sent",
5757
"workspaceInvite.sending": "Inviting…",
5858
"workspaceInvite.confirm": "Confirm and invite",
@@ -757,8 +757,8 @@ export const esES: Dict = {
757757
'workspaceSwitcher.team': 'Team',
758758
'workspaceSwitcher.invite': 'Invite colleague',
759759
'workspaceSwitcher.createTeam': 'New team',
760-
"workspaceSwitcher.draftsTooltip": "Drafts",
761-
"workspaceSwitcher.allProjectsTooltip": "All projects",
760+
"workspaceSwitcher.draftsTooltip": "Proyectos personales",
761+
"workspaceSwitcher.allProjectsTooltip": "Proyectos del equipo",
762762
"entry.primaryNavAria": "Primary",
763763
"entry.billingTierTeam": "Teams",
764764
"entry.billingTierFree": "Free",
@@ -842,8 +842,8 @@ export const esES: Dict = {
842842
'entry.navIntegrations': 'Integraciones',
843843
'entry.navMembers': 'Members',
844844
'entry.navWorkspaceSettings': 'Workspace settings',
845-
'entry.navDrafts': 'Drafts',
846-
'entry.navAllProjects': 'All projects',
845+
'entry.navDrafts': 'Proyectos personales',
846+
'entry.navAllProjects': 'Proyectos del equipo',
847847
'entry.draftsDescription': 'Projects you created, visible only to you',
848848
'entry.allProjectsDescription': 'Projects owned by everyone on the team',
849849
'entry.navBoard': 'Board',
@@ -1104,7 +1104,7 @@ export const esES: Dict = {
11041104
'recentProjects.moveToTeam': 'Move to team space',
11051105
'recentProjects.moveToTeamDescPre': 'Once moved to the team space, ',
11061106
'recentProjects.moveToTeamDescStrong': 'all team members can view and comment',
1107-
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "All projects".',
1107+
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "Team projects".',
11081108
'recentProjects.moveToPersonalDescPre': 'Once moved out of the team space, it returns to a personal project, ',
11091109
'recentProjects.moveToPersonalDescStrong': 'only you can view and edit it',
11101110
'recentProjects.moveToPersonalDescPost': '.',

apps/web/src/i18n/locales/fa.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const fa: Dict = {
5252
"workspaceInvite.removeRow": "Remove",
5353
"workspaceInvite.addMember": "Add member",
5454
"workspaceInvite.visibilityQuestion": "Will team members see my designs?",
55-
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Drafts are not visible to others.",
55+
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Personal projects are not visible to others.",
5656
"workspaceInvite.sent": "Invitation sent",
5757
"workspaceInvite.sending": "Inviting…",
5858
"workspaceInvite.confirm": "Confirm and invite",
@@ -757,8 +757,8 @@ export const fa: Dict = {
757757
'workspaceSwitcher.team': 'Team',
758758
'workspaceSwitcher.invite': 'Invite colleague',
759759
'workspaceSwitcher.createTeam': 'New team',
760-
"workspaceSwitcher.draftsTooltip": "Drafts",
761-
"workspaceSwitcher.allProjectsTooltip": "All projects",
760+
"workspaceSwitcher.draftsTooltip": "پروژه‌های شخصی",
761+
"workspaceSwitcher.allProjectsTooltip": "پروژه‌های تیم",
762762
"entry.primaryNavAria": "Primary",
763763
"entry.billingTierTeam": "Teams",
764764
"entry.billingTierFree": "Free",
@@ -842,8 +842,8 @@ export const fa: Dict = {
842842
'entry.navIntegrations': 'یکپارچه‌سازی‌ها',
843843
'entry.navMembers': 'Members',
844844
'entry.navWorkspaceSettings': 'Workspace settings',
845-
'entry.navDrafts': 'Drafts',
846-
'entry.navAllProjects': 'All projects',
845+
'entry.navDrafts': 'پروژه‌های شخصی',
846+
'entry.navAllProjects': 'پروژه‌های تیم',
847847
'entry.draftsDescription': 'Projects you created, visible only to you',
848848
'entry.allProjectsDescription': 'Projects owned by everyone on the team',
849849
'entry.navBoard': 'Board',
@@ -1104,7 +1104,7 @@ export const fa: Dict = {
11041104
'recentProjects.moveToTeam': 'Move to team space',
11051105
'recentProjects.moveToTeamDescPre': 'Once moved to the team space, ',
11061106
'recentProjects.moveToTeamDescStrong': 'all team members can view and comment',
1107-
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "All projects".',
1107+
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "Team projects".',
11081108
'recentProjects.moveToPersonalDescPre': 'Once moved out of the team space, it returns to a personal project, ',
11091109
'recentProjects.moveToPersonalDescStrong': 'only you can view and edit it',
11101110
'recentProjects.moveToPersonalDescPost': '.',

apps/web/src/i18n/locales/fr.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const fr: Dict = {
5252
"workspaceInvite.removeRow": "Remove",
5353
"workspaceInvite.addMember": "Add member",
5454
"workspaceInvite.visibilityQuestion": "Will team members see my designs?",
55-
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Drafts are not visible to others.",
55+
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Personal projects are not visible to others.",
5656
"workspaceInvite.sent": "Invitation sent",
5757
"workspaceInvite.sending": "Inviting…",
5858
"workspaceInvite.confirm": "Confirm and invite",
@@ -757,8 +757,8 @@ export const fr: Dict = {
757757
'workspaceSwitcher.team': 'Team',
758758
'workspaceSwitcher.invite': 'Invite colleague',
759759
'workspaceSwitcher.createTeam': 'New team',
760-
"workspaceSwitcher.draftsTooltip": "Drafts",
761-
"workspaceSwitcher.allProjectsTooltip": "All projects",
760+
"workspaceSwitcher.draftsTooltip": "Projets personnels",
761+
"workspaceSwitcher.allProjectsTooltip": "Projets d'équipe",
762762
"entry.primaryNavAria": "Primary",
763763
"entry.billingTierTeam": "Teams",
764764
"entry.billingTierFree": "Free",
@@ -842,8 +842,8 @@ export const fr: Dict = {
842842
'entry.navIntegrations': 'Intégrations',
843843
'entry.navMembers': 'Members',
844844
'entry.navWorkspaceSettings': 'Workspace settings',
845-
'entry.navDrafts': 'Drafts',
846-
'entry.navAllProjects': 'All projects',
845+
'entry.navDrafts': 'Projets personnels',
846+
'entry.navAllProjects': "Projets d'équipe",
847847
'entry.draftsDescription': 'Projects you created, visible only to you',
848848
'entry.allProjectsDescription': 'Projects owned by everyone on the team',
849849
'entry.navBoard': 'Board',
@@ -1104,7 +1104,7 @@ export const fr: Dict = {
11041104
'recentProjects.moveToTeam': 'Move to team space',
11051105
'recentProjects.moveToTeamDescPre': 'Once moved to the team space, ',
11061106
'recentProjects.moveToTeamDescStrong': 'all team members can view and comment',
1107-
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "All projects".',
1107+
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "Team projects".',
11081108
'recentProjects.moveToPersonalDescPre': 'Once moved out of the team space, it returns to a personal project, ',
11091109
'recentProjects.moveToPersonalDescStrong': 'only you can view and edit it',
11101110
'recentProjects.moveToPersonalDescPost': '.',

apps/web/src/i18n/locales/hu.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const hu: Dict = {
5252
"workspaceInvite.removeRow": "Remove",
5353
"workspaceInvite.addMember": "Add member",
5454
"workspaceInvite.visibilityQuestion": "Will team members see my designs?",
55-
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Drafts are not visible to others.",
55+
"workspaceInvite.visibilityAnswer": "Team members can see designs you share to the team space. Private designs kept in Personal projects are not visible to others.",
5656
"workspaceInvite.sent": "Invitation sent",
5757
"workspaceInvite.sending": "Inviting…",
5858
"workspaceInvite.confirm": "Confirm and invite",
@@ -757,8 +757,8 @@ export const hu: Dict = {
757757
'workspaceSwitcher.team': 'Team',
758758
'workspaceSwitcher.invite': 'Invite colleague',
759759
'workspaceSwitcher.createTeam': 'New team',
760-
"workspaceSwitcher.draftsTooltip": "Drafts",
761-
"workspaceSwitcher.allProjectsTooltip": "All projects",
760+
"workspaceSwitcher.draftsTooltip": "Személyes projektek",
761+
"workspaceSwitcher.allProjectsTooltip": "Csapatprojektek",
762762
"entry.primaryNavAria": "Primary",
763763
"entry.billingTierTeam": "Teams",
764764
"entry.billingTierFree": "Free",
@@ -842,8 +842,8 @@ export const hu: Dict = {
842842
'entry.navIntegrations': 'Integrációk',
843843
'entry.navMembers': 'Members',
844844
'entry.navWorkspaceSettings': 'Workspace settings',
845-
'entry.navDrafts': 'Drafts',
846-
'entry.navAllProjects': 'All projects',
845+
'entry.navDrafts': 'Személyes projektek',
846+
'entry.navAllProjects': 'Csapatprojektek',
847847
'entry.draftsDescription': 'Projects you created, visible only to you',
848848
'entry.allProjectsDescription': 'Projects owned by everyone on the team',
849849
'entry.navBoard': 'Board',
@@ -1104,7 +1104,7 @@ export const hu: Dict = {
11041104
'recentProjects.moveToTeam': 'Move to team space',
11051105
'recentProjects.moveToTeamDescPre': 'Once moved to the team space, ',
11061106
'recentProjects.moveToTeamDescStrong': 'all team members can view and comment',
1107-
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "All projects".',
1107+
'recentProjects.moveToTeamDescPost': ', and only the creator can edit. You can find it under "Team projects".',
11081108
'recentProjects.moveToPersonalDescPre': 'Once moved out of the team space, it returns to a personal project, ',
11091109
'recentProjects.moveToPersonalDescStrong': 'only you can view and edit it',
11101110
'recentProjects.moveToPersonalDescPost': '.',

0 commit comments

Comments
 (0)