Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
e81939b
fix: capture startup crashes before AndroidX providers
Batmancpu Nov 6, 2026
3565154
fix: make early crash records safe for unit tests
Batmancpu Nov 6, 2026
d70caac
fix: detect startup termination without a Java exception
Batmancpu Nov 6, 2026
e865c60
test: avoid Android process APIs in report formatters
Batmancpu Nov 6, 2026
d5e0bd8
fix: keep startup diagnostics from aborting launch
Batmancpu Nov 6, 2026
28a6950
test: align interruption report assertion with wording
Batmancpu Nov 6, 2026
b66315c
fix: keep startup crash diagnostics best-effort
Batmancpu Nov 6, 2026
7d81229
fix: stabilize startup rendering and consolidate network guards
Batmancpu Nov 6, 2026
319105b
fix: correct activity receiver in startup recovery screen
Batmancpu Nov 6, 2026
30da801
fix: keep activity context edits scoped to recovery UI
Batmancpu Nov 6, 2026
e763697
build: make stability APK install alongside existing app
Batmancpu Nov 6, 2026
5863d24
fix: correct stability build configuration and diagnostic package id
Batmancpu Nov 6, 2026
7ef1e04
Fix startup diagnostic stage ordering
Batmancpu Nov 6, 2026
7cc622a
Capture Android historical process exit diagnostics
Batmancpu Nov 6, 2026
8622ca4
Expose startup diagnostic parsing for unit tests
Batmancpu Nov 6, 2026
c6aee45
Test Android exit history and legacy startup report handling
Batmancpu Nov 6, 2026
e144b83
Version startup diagnostics test build 0.2.2
Batmancpu Nov 6, 2026
233668d
Label startup diagnostics build as v0.2.2
Batmancpu Nov 6, 2026
663cc08
Clarify startup interruption is not a Java stack trace
Batmancpu Nov 6, 2026
f6e4aa1
Fix nullable Android exit description formatting
Batmancpu Nov 6, 2026
d6b3af8
Restrict legacy false-positive cleanup to interruption reports
Batmancpu Nov 6, 2026
c34ba38
Protect genuine exception reports from legacy cleanup
Batmancpu Nov 6, 2026
4adef92
Persist stability APK debug signing key across CI runs
Batmancpu Nov 6, 2026
d0446cd
Use a dedicated signer for Stability test APKs
Batmancpu Nov 6, 2026
d8e3e60
Generate and cache dedicated Stability APK signing key
Batmancpu Nov 6, 2026
93e0c81
Fix Stability signing-key generation command
Batmancpu Nov 6, 2026
73a4018
privacy: disable WebView cookies in public reader
Batmancpu Nov 6, 2026
ed83844
Force Legacy graphics pipeline for Mali crash isolation
Batmancpu Nov 6, 2026
864c54e
Test Legacy renderer fallback on Android 13 and newer
Batmancpu Nov 6, 2026
de3473e
Version Legacy renderer isolation build as 0.2.3
Batmancpu Nov 6, 2026
369ca14
Label Legacy renderer isolation APK as v0.2.3
Batmancpu Nov 6, 2026
8d1c2f1
privacy: minimize local startup crash report metadata
Batmancpu Nov 6, 2026
ffce21c
privacy: remove device-specific wording from renderer note
Batmancpu Nov 6, 2026
17ce27a
test: verify crash reports omit device identifiers and raw traces
Batmancpu Nov 6, 2026
c9c93ee
cleanup: remove unused crash trace imports
Batmancpu Nov 6, 2026
84abdc6
fix: correct privacy assertion in diagnostics test
Batmancpu Nov 6, 2026
8849d10
release: bump privacy-hardened stability build to 0.2.4
Batmancpu Nov 6, 2026
f154a76
ci: label privacy-hardened stability artifact as 0.2.4
Batmancpu Nov 6, 2026
89099d2
ci: align release tag with privacy-hardened 0.2.4 build
Batmancpu Nov 6, 2026
731d172
stability: add plain first-launch probe before full Liquid Glass UI
Batmancpu Nov 6, 2026
032fc5d
restore: keep Prismal automatic Liquid Glass pipeline
Batmancpu Nov 6, 2026
7f8f319
build: add Stability test-build flag and version 0.2.5
Batmancpu Nov 6, 2026
6b2283c
diagnostics: mark stability probe healthy after initial Compose frames
Batmancpu Nov 6, 2026
35d6460
ci: build and label stability probe as 0.2.5
Batmancpu Nov 6, 2026
e08b569
stability: add minimal Compose launch isolation screen
Batmancpu Nov 6, 2026
c8468fd
fix: size stability probe action across available width
Batmancpu Nov 6, 2026
eb270de
privacy: explain minimised local recovery report
Batmancpu Nov 6, 2026
d3754da
remove obsolete forced Legacy startup renderer
Batmancpu Nov 6, 2026
3767fe1
remove obsolete test for forced Legacy renderer
Batmancpu Nov 6, 2026
822625a
docs: consolidate crash privacy and agent continuity rules
Batmancpu Nov 6, 2026
6183fd5
docs: add main commit index to agent continuity records
Batmancpu Nov 6, 2026
5f478ca
docs: clarify main-only release and temporary stability workflow
Batmancpu Nov 6, 2026
6aac8e5
test: isolate Prismal startup rendering stages without disabling Liqu…
Batmancpu Nov 6, 2026
8c5f29d
fix: isolate Prismal backdrop from glass surfaces
Batmancpu Nov 6, 2026
dce04ef
docs: record Prismal backdrop capture fix
Batmancpu Nov 6, 2026
d63c22d
fix: resolve recorded glass probe crash and polish reader UI
Batmancpu Nov 6, 2026
6ab1e6a
fix: minimise shareable process-exit diagnostics
Batmancpu Nov 6, 2026
976ebb0
feat(reader): add deterministic chrome and completion policy
Batmancpu Nov 6, 2026
5cbcf54
test(reader): cover text size and completion visibility
Batmancpu Nov 6, 2026
ab112cd
polish(reader): keep full definition word and accessible actions
Batmancpu Nov 6, 2026
599c9fa
feat(reader): add compact Prismal toolbar and completion dock
Batmancpu Nov 6, 2026
8944d39
chore(reader): remove obsolete definition action imports
Batmancpu Nov 6, 2026
0530551
docs(ui): track liquid glass coverage and performance roadmap
Batmancpu Nov 6, 2026
7950cba
fix(reader): preserve definition title line height
Batmancpu Nov 6, 2026
6bc66cc
fix(reader): distinguish unavailable and publisher fallback status
Batmancpu Nov 6, 2026
9f09b9c
docs(ui): clarify reader provenance status states
Batmancpu Nov 6, 2026
7b6ef88
fix(reader): pin completion while native selection is active
Batmancpu Nov 6, 2026
27ef99b
test(reader): cover native selection completion guard
Batmancpu Nov 6, 2026
1f245e6
fix(reader): keep completion clear of native selection actions
Batmancpu Nov 6, 2026
1f7cd2e
docs(reader): record native selection collision guard
Batmancpu Nov 6, 2026
b09fd86
ci: validate PRs stacked on startup stability branch
Batmancpu Nov 6, 2026
5dc3179
ci: restore Android SDK setup before sdkmanager
Batmancpu Nov 6, 2026
d835d2a
Integrate stacked read-only CI into Black Box Bihar News
Batmancpu Nov 7, 2026
0e01bd5
ci: validate the consolidated Black Box Bihar News branch
Batmancpu Nov 7, 2026
c6223c9
Integrate Reader Liquid Glass redesign into Black Box Bihar News
Batmancpu Nov 7, 2026
4f9edd8
feat: consolidate publication dates and provenance policies
Batmancpu Nov 7, 2026
53e07a5
fix: select Atom article alternate links safely
Batmancpu Nov 7, 2026
a0d28e9
perf: move local history persistence off main and bound new reads
Batmancpu Nov 7, 2026
ca5fbe5
perf: move read and reader persistence off main
Batmancpu Nov 7, 2026
3981295
fix: deduplicate RSS tracking variants without losing read state
Batmancpu Nov 7, 2026
e23e021
feat: consolidate GS I Geography and editorial false-positive safeguards
Batmancpu Nov 7, 2026
94bce18
fix: preserve exact saved/read variants and update syllabus tests
Batmancpu Nov 7, 2026
88b0fdf
test: assert syllabus rationale in article cards
Batmancpu Nov 7, 2026
f031bf2
fix: finish syllabus metadata and thin-film feed eligibility
Batmancpu Nov 7, 2026
d809166
feat: hide Reader glass chrome during downward reading scroll
Batmancpu Nov 7, 2026
050f3ad
feat: compact feed navigation on scroll
Batmancpu Nov 7, 2026
78d93a4
feat: consolidate feed navigation and adaptive glass contrast
Batmancpu Nov 7, 2026
6f15200
test: correct compact navigation threshold boundary
Batmancpu Nov 7, 2026
ebdfdd7
ui: unify dashboard cards and refine glass appearance preview
Batmancpu Nov 7, 2026
208e606
fix: require specific parliamentary syllabus signals
Batmancpu Nov 7, 2026
9d75495
test: preserve Parliament bill headline variants
Batmancpu Nov 7, 2026
67d1f6a
docs: record full CurrentLens branch consolidation and validation
Batmancpu Nov 7, 2026
46c7d77
fix: require specific parliamentary syllabus signals
Batmancpu Nov 7, 2026
e411c39
docs: include parliamentary gate and final branch inventory
Batmancpu Nov 7, 2026
5e966a1
ui: unify supporting glass surfaces across You and stats
Batmancpu Nov 7, 2026
c8afed0
docs: refresh liquid glass roadmap and branch graph audit
Batmancpu Nov 7, 2026
cfe0b3e
perf(reader): restore saved position off the UI thread
Batmancpu Nov 7, 2026
2e2c15f
feat(appearance): add app-wide reduced-transparency mode
Batmancpu Nov 7, 2026
3a08bb9
ui: unify Saved and stats filter glass controls
Batmancpu Nov 7, 2026
947310a
feat(quiz): add compact Prismal action chrome
Batmancpu Nov 7, 2026
6f9b3c1
fix(quiz): qualify selected semantics receiver
Batmancpu Nov 7, 2026
16eb549
docs: record quiz build repair and live branch audit
Batmancpu Nov 7, 2026
59022ed
ui: unify transient search and reader glass controls
Batmancpu Nov 7, 2026
f7e10ab
perf(storage): move bookmark mutations off the UI thread
Batmancpu Nov 7, 2026
ee82dfd
ui: consolidate Appearance preview into one Prismal surface
Batmancpu Nov 7, 2026
d75723d
perf(startup): restore appearance preferences on IO
Batmancpu Nov 7, 2026
48b5480
a11y: enforce 48dp icon action targets
Batmancpu Nov 7, 2026
ec86b2f
perf(ui): unify Reader and Quiz transient glass chrome
Batmancpu Nov 7, 2026
818afb4
ui: refine supporting glass tone across dashboard and stats
Batmancpu Nov 7, 2026
ed6c941
fix(reader): pin chrome while Aa menu is open
Batmancpu Nov 7, 2026
ad16cec
ui: improve grouped filter legibility and reuse
Batmancpu Nov 7, 2026
f2ad2b5
ui: align feed skeleton geometry with article cards
Batmancpu Nov 7, 2026
d8b7146
ui: define shared supporting-card geometry
Batmancpu Nov 7, 2026
41b572e
test(ui): cover supporting-card geometry
Batmancpu Nov 7, 2026
dfcc792
ui: unify You and statistics supporting surfaces
Batmancpu Nov 7, 2026
25641b7
docs(ui): record supporting-surface consistency pass
Batmancpu Nov 7, 2026
ccce7be
docs(repo): record live integration and UI batch audit
Batmancpu Nov 7, 2026
4a7a8f8
docs(ui): record exact supporting-surface CI result
Batmancpu Nov 7, 2026
d451d22
ui(search): retain focus and animate clear affordance
Batmancpu Nov 7, 2026
6f777f8
fix(search): provide RowScope for clear animation
Batmancpu Nov 7, 2026
d9a4d1e
ui(glass): bind supporting surfaces to appearance intensity
Batmancpu Nov 7, 2026
31e3bf7
a11y(ui): honor system Reduce Motion across app transitions
Batmancpu Nov 7, 2026
94a1e9a
ui(appearance): align live preview controls with glass intensity
Batmancpu Nov 8, 2026
b06557a
ui(quiz): give answer controls clear glass-derived states
Batmancpu Nov 8, 2026
c7d50bb
docs(ui): record Quiz batch and live branch audit
Batmancpu Nov 8, 2026
c6deffb
ui(glass): lighten shared header and release compact nav captures
Batmancpu Nov 8, 2026
12f5831
docs(ui): record shared shell optical optimization
Batmancpu Nov 8, 2026
400496d
test(glass): compare header blur against prior profile
Batmancpu Nov 8, 2026
df5a75c
docs(ui): record exact-head glass CI and test correction
Batmancpu Nov 8, 2026
a159846
ui: unify glass filter control hierarchy
Batmancpu Nov 8, 2026
7ee0976
docs: record unified glass filter control batch
Batmancpu Nov 8, 2026
748683f
ui(appearance): unify editor panel with supporting glass
Batmancpu Nov 8, 2026
45a3264
ui(search): align filter action with shared glass controls
Batmancpu Nov 8, 2026
35b2902
docs(ui): record Search glass action batch and branch audit
Batmancpu Nov 8, 2026
cc5a01b
perf(search): reuse article relevance index
Batmancpu Nov 8, 2026
5f7e8cf
ui(today): align weekend surface and loading semantics
Batmancpu Nov 8, 2026
d1d7458
fix(reader): reveal completion action after reaching article end
Batmancpu Nov 8, 2026
d5fab2a
docs(reader): scope chrome policy comments correctly
Batmancpu Nov 8, 2026
bf87623
fix(today): refresh editorial index at IST midnight
Batmancpu Nov 8, 2026
90508da
perf(ui): cache NewsCard palette glow draw resources
Batmancpu Nov 8, 2026
9efd103
docs: record RSS Atom content review and CI snapshot
Batmancpu Nov 8, 2026
8c1239a
docs: record RSS redirect boundary review
Batmancpu Nov 8, 2026
f73ea24
ui(appearance): reuse shared glass page header
Batmancpu Nov 8, 2026
c7f3711
docs: record appearance header and live branch audit
Batmancpu Nov 8, 2026
d21ff27
ui(glass): unify continuous control corner geometry
Batmancpu Nov 8, 2026
21fee7f
perf(saved): reuse cached relevance across filters and cards
Batmancpu Nov 8, 2026
f7cc74a
docs(ui): record saved-feed reuse and live branch audit
Batmancpu Nov 8, 2026
261c387
docs(repo): clarify source and audit ancestry counts
Batmancpu Nov 8, 2026
0e94d82
perf(saved): reuse eligibility relevance for previously opened cards
Batmancpu Nov 8, 2026
f65d724
ui: unify Search action pill continuous geometry
Batmancpu Nov 8, 2026
5863f29
fix(reader): reveal hidden chrome on intentional content tap
Batmancpu Nov 8, 2026
6160d58
perf(ui): coalesce feed scroll idle settling
Batmancpu Nov 8, 2026
58c2e5d
ui(search): remove competing inline glass panel
Batmancpu Nov 8, 2026
86e095d
fix(reader): release WebView resources on permanent disposal
Batmancpu Nov 8, 2026
3173bd9
docs: record Reader disposal CI and live branch inventory
Batmancpu Nov 8, 2026
4f3d049
perf(startup): move local diagnostics off the main thread
Batmancpu Nov 8, 2026
98a5ee0
fix(search): hide clear action while field is inactive
Batmancpu Nov 8, 2026
4f5bdf3
fix(reader): cancel restore settle and preserve fatal cleanup errors
Batmancpu Nov 8, 2026
022a288
ui(feed): add restrained shared card rim
Batmancpu Nov 8, 2026
18828f7
fix(ui): restore feed card rim and refresh integration ledger
Batmancpu Nov 9, 2026
4a7389f
ui(glass): apply reduced-transparency fallback to supporting surfaces
Batmancpu Nov 9, 2026
0b32cb5
docs(glass): record supporting-surface CI and transient audit
Batmancpu Nov 9, 2026
21317fd
a11y: respect system motion in dictionary popup
Batmancpu Nov 9, 2026
11b709a
perf(ui): quiesce hidden compact navigation motion
Batmancpu Nov 9, 2026
52604e5
docs: verify compact navigation CI and refresh branch inventory
Batmancpu Nov 9, 2026
8c59dcc
a11y: respect Reduce Transparency in dictionary popup
Batmancpu Nov 9, 2026
23acb97
ui: suppress brief cold-feed skeleton flashes
Batmancpu Nov 9, 2026
45609a3
fix(reader): isolate WebView disposal cleanup steps
Batmancpu Nov 9, 2026
42d4130
docs: record Reader teardown and live branch inventory
Batmancpu Nov 9, 2026
80d072b
docs: record Reader disposal CI verification
Batmancpu Nov 9, 2026
2b1878e
docs: refresh branch inventory and next glass target
Batmancpu Nov 9, 2026
fb2e75c
ui(glass): align definition popup with transient material tier
Batmancpu Nov 9, 2026
b8d87f7
docs: record shared definition glass integration and branch audit
Batmancpu Nov 9, 2026
59c54ce
test(glass): align non-finite tint expectation with default
Batmancpu Nov 9, 2026
aee50ff
docs: record transient tint CI correction and recovery
Batmancpu Nov 9, 2026
26878fc
ui(glass): tune supporting surfaces across appearance intensity
Batmancpu Nov 9, 2026
8daadee
test(glass): preserve supporting transparency fallback coverage
Batmancpu Nov 9, 2026
e14b284
docs: record CurrentLens takeover, implementation audit and signing path
Batmancpu Nov 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 60 additions & 12 deletions .github/workflows/build-apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,32 @@ name: Build Android APK

on:
push:
branches: [ main ]
branches:
- main
- fix/early-startup-crash-diagnostics-2026-11-06
- black-box-bihar-news
pull_request:
branches:
- main
- fix/early-startup-crash-diagnostics-2026-11-06
- black-box-bihar-news
types: [ opened, synchronize, reopened, ready_for_review ]

# Build and test jobs are read-only. Release write access is isolated below.
permissions:
contents: write
contents: read

concurrency:
group: currentlens-android-build
cancel-in-progress: false
group: currentlens-android-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
name: Build debug APK
name: Build and test debug APK
runs-on: ubuntu-latest
timeout-minutes: 40
permissions:
contents: read
steps:
- name: Checkout source
uses: actions/checkout@v5
Expand All @@ -26,6 +38,20 @@ jobs:
distribution: temurin
java-version: '17'

- name: Restore stable Stability test signing key
id: stability-signing-cache
uses: actions/cache@v4
with:
path: .ci/stability-debug.keystore
key: currentlens-stability-debug-keystore-v1

- name: Generate Stability test signing key on cache miss
if: steps.stability-signing-cache.outputs.cache-hit != 'true'
run: |
set -euo pipefail
mkdir -p .ci
keytool -genkeypair -noprompt -v -keystore .ci/stability-debug.keystore -storetype JKS -storepass currentlens-stability-test-only -keypass currentlens-stability-test-only -alias currentlens-stability -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=CurrentLens Stability Debug,O=CurrentLens,C=IN"

- name: Set up Android SDK
uses: android-actions/setup-android@v3
with:
Expand Down Expand Up @@ -58,28 +84,50 @@ jobs:
--min-unique-words 100000
test -s app/src/main/assets/wordnet.db

- name: Compile APK
run: gradle --no-daemon --stacktrace :app:testDebugUnitTest :app:assembleDebug
- name: Compile APK and run JVM tests
shell: bash
run: |
set -euo pipefail
if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
gradle --no-daemon --stacktrace :app:testDebugUnitTest :app:assembleDebug
else
gradle --no-daemon --stacktrace -PstabilityTest=true :app:testDebugUnitTest :app:assembleDebug
fi

- name: Upload installable APK artifact
uses: actions/upload-artifact@v4
with:
name: CurrentLens-v0.2.0-debug-apk
name: CurrentLens-v0.2.8-stability-debug-apk
path: app/build/outputs/apk/debug/app-debug.apk
if-no-files-found: error
retention-days: 14

publish:
name: Publish main-branch testing release
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- name: Download APK built and tested by this workflow run
uses: actions/download-artifact@v4
with:
name: CurrentLens-v0.2.8-stability-debug-apk
path: release-assets

- name: Publish direct APK download in GitHub Releases
uses: softprops/action-gh-release@v2
with:
tag_name: v0.2.0-build-${{ github.run_number }}
name: CurrentLens v0.2.0 (Build ${{ github.run_number }})
tag_name: v0.2.8-build-${{ github.run_number }}
name: CurrentLens v0.2.8 (Build ${{ github.run_number }})
body: |
CurrentLens v0.2.0 testing build.
CurrentLens v0.2.8 testing build.
Package: com.mangoloads.currentlens
Includes the four-tab editorial redesign, Prismal AGSL glass controls, a 30-day local article metadata cache,
Express Sunday Eye RSS, best-effort public-page extraction with in-app publisher fallback, offline WordNet definitions.
Debug-signed APK for testing; not a production or Play Store release.
files: app/build/outputs/apk/debug/app-debug.apk
files: release-assets/app-debug.apk
prerelease: true
make_latest: false
168 changes: 168 additions & 0 deletions AGENTS.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ There is no Archive destination and no Saved bottom tab. **Saved** is a section

## Liquid Glass rendering

Navigation and Search share one foreground-only 8×8 luminance probe over a full-width 104 dp band at the bottom of the captured page. The region follows the root content height when the IME opens, so adaptive contrast reflects the scene immediately behind the floating controls rather than averaging unrelated content across the whole screen. Sampling retains PrismalAGSL v1.0.4's 600 ms RenderEffect / 1500 ms legacy cadence and adds no dependency.
Navigation and Search use the existing Prismal background-only root capture and one shared foreground-luminance probe. The probe reads an 8×8 sample from a 104 dp bottom band, which follows the root content edge when the IME opens. It runs only on foreground home surfaces while the feed is idle, pauses during scrolling, Reader, Settings and background operation, and uses a conservative 4 s cadence on Android 12+ / 6 s on older versions. The selected foreground uses linearized sRGB relative luminance. No second backdrop source or per-card sampler is created. Device frame-time and battery impact still require physical-device profiling.

## Personal data and study statistics

Expand Down
36 changes: 32 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ plugins {
id("org.jetbrains.kotlin.plugin.compose")
}

val stabilityTestBuild = providers.gradleProperty("stabilityTest").orNull == "true"

android {
namespace = "com.mangoloads.currentlens"
compileSdk = 37
Expand All @@ -11,15 +13,41 @@ android {
applicationId = "com.mangoloads.currentlens"
minSdk = 26
targetSdk = 35
versionCode = 2
versionName = "0.2.0"
versionCode = 10
versionName = "0.2.8"
manifestPlaceholders["appLabel"] = if (stabilityTestBuild) "brrrNews Stability" else "brrrNews"
buildConfigField("boolean", "STABILITY_TEST_BUILD", stabilityTestBuild.toString())
}

signingConfigs {
if (stabilityTestBuild) {
create("stability") {
storeFile = rootProject.file(".ci/stability-debug.keystore")
storePassword = "currentlens-stability-test-only"
keyAlias = "currentlens-stability"
keyPassword = "currentlens-stability-test-only"
}
}
}

buildTypes {
getByName("debug") {
if (stabilityTestBuild) {
applicationIdSuffix = ".stability"
versionNameSuffix = "-stability"
signingConfig = signingConfigs.getByName("stability")
}
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures { compose = true }
buildFeatures {
compose = true
buildConfig = true
}
}

dependencies {
Expand All @@ -36,7 +64,7 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
implementation("org.jsoup:jsoup:1.23.2")

implementation("com.github.styropyr0:PrismalAGSL:v1.0.4")
implementation("com.github.styropyr0:PrismalAGSL:v1.0.6")

testImplementation("junit:junit:4.13.2")

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".CurrentLensApplication"
android:allowBackup="false"
android:label="brrrNews"
android:label="${appLabel}"
android:supportsRtl="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.mangoloads.currentlens

internal data class LocalAppearancePreferences(
val glassAlpha: Float = AppearancePreferencesPolicy.DEFAULT_GLASS_ALPHA,
val reduceTransparency: Boolean = false
)

/** Pure normalization for the two small appearance values restored with local app state. */
internal object AppearancePreferencesPolicy {
const val DEFAULT_GLASS_ALPHA = 0.28f
const val MIN_GLASS_ALPHA = 0.12f
const val MAX_GLASS_ALPHA = 0.55f

fun normalizeGlassAlpha(value: Float): Float =
if (value.isFinite()) value.coerceIn(MIN_GLASS_ALPHA, MAX_GLASS_ALPHA)
else DEFAULT_GLASS_ALPHA

fun create(glassAlpha: Float, reduceTransparency: Boolean): LocalAppearancePreferences =
LocalAppearancePreferences(
glassAlpha = normalizeGlassAlpha(glassAlpha),
reduceTransparency = reduceTransparency
)
}
22 changes: 16 additions & 6 deletions app/src/main/java/com/mangoloads/currentlens/ArticleCachePolicy.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
package com.mangoloads.currentlens

/**
* Retains the newest article metadata within the local cache budget while treating
* bookmarked stories as pinned entries. The cache may exceed the soft limit only
* when the user has explicitly saved more stories than that limit.
* Retains the newest dated article metadata within the local cache budget while treating
* bookmarked stories as pinned entries. Undated and materially future-dated feed items
* cannot be placed reliably on the Today/Explore timeline, so they are excluded unless
* the user explicitly saves them.
*/
internal object ArticleCachePolicy {
private const val FUTURE_DATE_TOLERANCE_MILLIS = 5L * 60L * 1000L

fun retain(
articles: List<Article>,
bookmarkedUrls: Set<String>,
cutoffMillis: Long,
maxArticles: Int
maxArticles: Int,
nowMillis: Long = System.currentTimeMillis()
): List<Article> {
val latestAllowedMillis = nowMillis + FUTURE_DATE_TOLERANCE_MILLIS
val eligible = articles
.distinctBy { it.url.ifBlank { it.id } }
.filter { article ->
val publishedAt = article.publishedAtMillis
publishedAt == null || publishedAt >= cutoffMillis || article.url in bookmarkedUrls
if (article.url in bookmarkedUrls) {
true
} else {
article.publishedAtMillis?.let { publishedAt ->
publishedAt >= cutoffMillis && publishedAt <= latestAllowedMillis
} == true
}
}
.sortedByDescending { it.publishedAtMillis ?: Long.MIN_VALUE }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
package com.mangoloads.currentlens

/** Keeps the feed's syllabus hint concise and exposes the actual matched signal. */
/** Keeps the feed's syllabus hint concise and exposes both its evidence and syllabus connection. */
internal object ArticleCardMetaPolicy {
fun syllabusHint(
gsPaper: String,
subject: String,
matchedTerms: List<String>
matchedTerms: List<String>,
syllabusLink: String
): String? {
if (matchedTerms.isEmpty()) return null
if (gsPaper.isBlank() || gsPaper.equals("Unmapped", ignoreCase = true)) return null
if (subject.isBlank() || subject.equals("Unmapped", ignoreCase = true)) return null
if (syllabusLink.isBlank()) return null

val signals = matchedTerms.map { it.trim() }
.filter { it.isNotEmpty() }
.distinct()
.take(2)
if (signals.isEmpty()) return null

return "Indicative · $gsPaper · $subject\nSignal: " + signals.joinToString(", ")
return "Indicative · $gsPaper · $subject\nSignals: ${signals.joinToString(", ")}\nSyllabus: $syllabusLink"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.mangoloads.currentlens

import java.util.Locale

/**
* Distinguishes publisher-feed metadata from official primary-source evidence.
* Unknown and legacy provenance is never promoted to a primary-source label.
*/
internal object ArticleProvenancePolicy {
private val publisherRssSources = setOf(
"the hindu",
"indian express",
"bbc",
"dw",
"al jazeera"
)

fun label(source: String, feedUrl: String): String {
if (feedUrl.isBlank()) return "Feed provenance unavailable"
return if (source.trim().lowercase(Locale.ROOT) in publisherRssSources) {
"Publisher RSS · secondary source"
} else {
"Source type unverified"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,22 @@ internal object ArticlePublicationDatePolicy {
private val formatter = DateTimeFormatter
.ofPattern("d MMM uuuu", Locale.ENGLISH)
.withZone(indiaZone)
private val compactFormatter = DateTimeFormatter
.ofPattern("d MMM uuuu · h:mm a 'IST'", Locale.ENGLISH)
.withZone(indiaZone)

fun label(publishedAtMillis: Long?): String {
if (publishedAtMillis == null) return "Date unavailable"
return runCatching {
"Date: ${formatter.format(Instant.ofEpochMilli(publishedAtMillis))} (IST)"
}.getOrDefault("Date unavailable")
}

/** Compact card label with the publisher timestamp rendered in India Standard Time. */
fun compactLabel(publishedAtMillis: Long?): String {
if (publishedAtMillis == null) return "Date unavailable"
return runCatching {
compactFormatter.format(Instant.ofEpochMilli(publishedAtMillis))
}.getOrDefault("Date unavailable")
}
}
Loading
Loading