Skip to content

Add config setting for default repository view#74

Open
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-aebfb0d2-4782-436c-aa16-761e33763dfe
Open

Add config setting for default repository view#74
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-aebfb0d2-4782-436c-aa16-761e33763dfe

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 30, 2025

Adds configurable default repository view setting at both server and user levels with comprehensive test coverage.

Implementation Summary

Key Components:

  • RepositoryDefaultView enum with Detail, Tree, Commits, Tags options
  • Server-level default setting (global for all users)
  • User-level override setting (with "Use Server Default" option)
  • Updated navigation in repository list and dropdown to respect settings
  • Database migrations for both SQLite and SQL Server

Resolution Order:
User Setting → Server Setting → Detail (fallback)

The feature allows administrators to set a site-wide default view, while individual users can customize their own preference or inherit the server default.

How It Works

  • For Administrators: Navigate to Server → Settings and select the default repository view for all users
  • For Users: Navigate to Account → Settings and either select a personal preference or use the server default
  • When navigating: Clicking on repository names now directs users to their configured preferred view

Test Coverage

Added comprehensive test suite with 29 new tests (all passing):

  • RepositoryViewHelperTests (5 tests): Validates action name mapping for each view type
  • ServerSettingsServiceTests (6 tests): Tests server settings persistence, retrieval, defaults, and caching
  • UserSettingsServiceTests (9 tests): Tests user settings persistence, null handling, multi-user scenarios, and cache behavior
  • RepositoryDefaultViewTests (9 tests): Validates enum values, Display attributes, and resource bindings

Total test suite: 266 tests passing

Fixes #46

Original prompt

This section details on the original issue you should resolve

<issue_title>Add config setting for default repository view</issue_title>
<issue_description>Sometimes I would like this.</issue_description>

<agent_instructions>Before changing code, provide a described solution and ask for confirmation.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@Matt-17 There should be a setting in Server/Settings and User/Settings.
Fixes #46

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add config setting for default repository view Add config setting for default repository view Sep 30, 2025
Copilot AI requested a review from Matt-17 September 30, 2025 12:40
@Matt-17
Copy link
Copy Markdown
Contributor

Matt-17 commented Sep 30, 2025

@copilot This sounds like a great plan. Execute it!

- Created RepositoryDefaultView enum with Detail, Tree, Commits, Tags options
- Added DefaultRepositoryView to ServerSettings and UserSettings infrastructure
- Updated Server and User Settings views with dropdown selectors
- Added RepositoryViewHelper to map view enum to action names
- Updated RepositoryListViewComponent and Index.cshtml to use configured default view
- Created database migrations for both SQLite and SQL Server
- Added resource strings for new settings

Co-authored-by: Matt-17 <11333169+Matt-17@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Sep 30, 2025

@copilot This sounds like a great plan. Execute it!

Done! I've implemented the default repository view configuration feature with the following changes:

Commit: 57c3f47

What was added:

  1. RepositoryDefaultView enum - Supports Detail, Tree, Commits, and Tags views
  2. Server Settings - Global default repository view configuration (defaults to Detail)
  3. User Settings - User-specific override with "Use Server Default" option
  4. Navigation Updates - Repository links now respect user/server preferences
  5. Database Migrations - Created for both SQLite and SQL Server

How it works:

  • Administrators can set a global default view in Server → Settings
  • Users can override this in Account → Settings (or use server default)
  • When users click on repository names, they navigate to their configured preferred view
  • Resolution order: User Setting → Server Setting → Detail (fallback)

The new dropdown appears in both Server Settings and User Settings views, allowing selection between Detail, Browse (Tree), Commits, and Tags views.

@Matt-17
Copy link
Copy Markdown
Contributor

Matt-17 commented Sep 30, 2025

@copilot Fine. Add some tests!

- Added RepositoryViewHelperTests: 5 tests validating action name mapping
- Added ServerSettingsServiceTests: 6 tests for server-level settings persistence
- Added UserSettingsServiceTests: 9 tests for user-level settings and overrides
- Added RepositoryDefaultViewTests: 9 tests for enum values and Display attributes
- All 29 new tests pass, total test suite: 266 tests passing

Co-authored-by: Matt-17 <11333169+Matt-17@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Sep 30, 2025

@copilot Fine. Add some tests!

Added comprehensive test suite with 29 tests covering all aspects of the default repository view feature.

Commit: fe3468f

Test Coverage:

  • RepositoryViewHelperTests (5 tests) - Validates action name mapping for Detail, Tree, Commits, Tags, and invalid values
  • ServerSettingsServiceTests (6 tests) - Tests server settings persistence, retrieval, defaults, updates, and caching
  • UserSettingsServiceTests (9 tests) - Tests user settings with null handling, multi-user scenarios, server default fallback, and cache behavior
  • RepositoryDefaultViewTests (9 tests) - Validates enum values, Display attributes, and resource string bindings

All 29 new tests pass. Total test suite: 266 tests passing.

@Matt-17 Matt-17 marked this pull request as ready for review September 30, 2025 13:16
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.

Add config setting for default repository view

2 participants