Skip to content

Commit 34f9df4

Browse files
committed
docs: update changeset with context-aware dev owners details
1 parent 2d76c6c commit 34f9df4

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.changeset/perf-indexing-ux-improvements.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ Massive indexing performance and UX improvements
2727
- **Slow file detection**: Debug logs for files/batches taking >5s to process
2828
- **Cleaner completion summary**: Removed storage size from index output (shown in `dev stats` instead)
2929
- **Continuous feedback**: Maximum 1-second gaps between progress updates
30+
- **Context-aware `dev owners` command**: Adapts output based on git status and current directory
31+
- **Changed files mode**: Shows ownership of uncommitted changes (for PR reviews)
32+
- **Root directory mode**: High-level overview of top areas (packages/cli/, packages/core/)
33+
- **Subdirectory mode**: Detailed expertise for specific area
34+
- **Visual hierarchy**: Tree branches (├─, └─) and emojis (📝, 📁, 👤) for better readability
35+
- **Activity-focused**: Sorted by last active, not file count (no more leaderboard vibes)
3036
- **Better developer grouping**: `dev owners` now groups by GitHub handle instead of email (merges multiple emails for same developer)
31-
- **File breakdown per developer**: Shows top 5 files owned with commit counts and LOC
3237
- **Graceful degradation**: Verbose mode and non-TTY environments show traditional log output
3338

3439
**Technical Details:**

packages/cli/src/commands/owners.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function isAtRepoRoot(repositoryPath: string): boolean {
105105
function getCurrentDirectory(repositoryPath: string): string {
106106
const cwd = process.cwd();
107107
if (cwd === repositoryPath) return '';
108-
return cwd.replace(repositoryPath, '').replace(/^\//, '') + '/';
108+
return `${cwd.replace(repositoryPath, '').replace(/^\//, '')}/`;
109109
}
110110

111111
/**
@@ -226,7 +226,7 @@ function formatChangedFilesMode(
226226
changedFiles: string[],
227227
fileOwners: Map<string, { owner: string; commits: number; lastActive: Date | null }>,
228228
currentUser: string,
229-
repositoryPath: string
229+
_repositoryPath: string
230230
): string {
231231
let output = '';
232232
output += chalk.bold('📝 Modified files') + chalk.gray(` (${changedFiles.length}):\n`);
@@ -340,7 +340,7 @@ function formatSubdirectoryMode(
340340
): string {
341341
// Filter developers to only those with files in current directory
342342
const relevantDevs = developers.filter((dev) =>
343-
dev.topFiles.some((f) => f.path.startsWith(repositoryPath + '/' + currentDir))
343+
dev.topFiles.some((f) => f.path.startsWith(`${repositoryPath}/${currentDir}`))
344344
);
345345

346346
if (relevantDevs.length === 0) {
@@ -358,7 +358,7 @@ function formatSubdirectoryMode(
358358

359359
// Show top files in this directory
360360
const filesInDir = primary.topFiles
361-
.filter((f) => f.path.startsWith(repositoryPath + '/' + currentDir))
361+
.filter((f) => f.path.startsWith(`${repositoryPath}/${currentDir}`))
362362
.slice(0, 5);
363363

364364
if (filesInDir.length > 0) {
@@ -470,7 +470,7 @@ export const ownersCommand = new Command('owners')
470470
>();
471471
for (const dev of developers) {
472472
for (const fileData of dev.topFiles) {
473-
const relativePath = fileData.path.replace(repositoryPath + '/', '');
473+
const relativePath = fileData.path.replace(`${repositoryPath}/`, '');
474474
if (!fileOwners.has(relativePath)) {
475475
fileOwners.set(relativePath, {
476476
owner: dev.displayName,

0 commit comments

Comments
 (0)