Skip to content

Conversation

@Elelan
Copy link

@Elelan Elelan commented Sep 10, 2025

Added Creative Common Licensing to Internet Archive
Refactored Internet Archive Feature from redux pattern to MVI
Code cleanup (removed unused activities) - since most of the screens are migrated to fragments linked in one navgraph or compose
library upgrades
minor text changes as per requirement

IA refactor to MVI from Redux
CC License Setup Screen Compose Migration
IA Detail Screen CC License Integration
SpaceList screen add btn size increased
Copilot AI review requested due to automatic review settings September 10, 2025 12:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Internet Archive feature from Redux pattern to MVI architecture while adding Creative Commons licensing support and performing cleanup of unused components. The changes streamline the navigation flow and improve code maintainability by migrating to a fragment-based approach within a unified navigation graph.

Key changes:

  • Migrated Internet Archive from Redux pattern to MVI architecture with proper state management
  • Added CC0 licensing option alongside existing Creative Commons licensing
  • Removed deprecated activities and consolidated navigation flow to use fragments
  • Updated library dependencies and performed code cleanup

Reviewed Changes

Copilot reviewed 46 out of 46 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
gradle/libs.versions.toml Library version upgrades including AGP, test runner, Koin, and security dependencies
app/src/main/res/navigation/space_setup_navigation.xml Updated navigation flow to use new Internet Archive fragments and license setup
app/src/main/res/layout/content_cc.xml Added CC0 licensing option with new switch component
app/src/main/java/net/opendasharchive/openarchive/features/internetarchive/presentation/login/ Migrated from Redux to MVI pattern with proper state management
app/src/main/java/net/opendasharchive/openarchive/features/settings/license/ New unified license setup fragment supporting multiple space types
app/src/main/java/net/opendasharchive/openarchive/services/webdav/ Removed deprecated activities and updated fragments to use navigation args

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

<TextView
android:layout_width="240dp"
android:layout_height="wrap_content"
android:textFontWeight="500"
Copy link

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using android:textFontWeight requires API level 28+. Consider using android:textStyle="bold" or defining font weights in a custom font family for better compatibility.

Copilot uses AI. Check for mistakes.
private lateinit var binding: FragmentWebdavSetupLicenseBinding

private var mSpaceId by Delegates.notNull<Long>()
private val args: SetupLicenseFragmentArgs by navArgs()
Copy link

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The args property is accessed before binding is initialized in onCreateView. Consider reordering these declarations or ensuring proper initialization order to avoid potential issues.

Copilot uses AI. Check for mistakes.
private var mSpaceId by Delegates.notNull<Long>()
private val args: SetupLicenseFragmentArgs by navArgs()

private lateinit var binding: FragmentSetupLicenseBinding
Copy link

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The args property is accessed before binding is initialized in onCreateView. Consider reordering these declarations or ensuring proper initialization order to avoid potential issues.

Copilot uses AI. Check for mistakes.
Comment on lines 27 to 30
val space: Space = if (spaceId == -1L) {
Space(Space.Type.INTERNET_ARCHIVE)
} else {
Space.get(spaceId) ?: Space(Space.Type.INTERNET_ARCHIVE)
Copy link

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The space property is declared as val but contains mutable logic. Consider making this a function or private property with lazy initialization to better reflect its behavior and improve testability.

Suggested change
val space: Space = if (spaceId == -1L) {
Space(Space.Type.INTERNET_ARCHIVE)
} else {
Space.get(spaceId) ?: Space(Space.Type.INTERNET_ARCHIVE)
private val space: Space by lazy {
if (spaceId == -1L) {
Space(Space.Type.INTERNET_ARCHIVE)
} else {
Space.get(spaceId) ?: Space(Space.Type.INTERNET_ARCHIVE)
}

Copilot uses AI. Check for mistakes.

private fun loadSpaceData() {
try {
val metaData = if (space.metaData.isNotEmpty()) {
Copy link

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metaData property access should be null-safe. If space.metaData is null, calling .isNotEmpty() will throw a NullPointerException. Use space.metaData?.isNotEmpty() == true instead.

Suggested change
val metaData = if (space.metaData.isNotEmpty()) {
val metaData = if (space.metaData?.isNotEmpty() == true) {

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var metaData: String = "".

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@Elelan Elelan merged commit 9ad7f42 into next Sep 10, 2025
2 checks passed
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.

2 participants