-
Notifications
You must be signed in to change notification settings - Fork 0
[User Availability] Update sending availability flow #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bf66194
04da618
e0a5e2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ private fun SelectableGrid( | |
| updateGrid: ((List<BooleanArray>) -> List<BooleanArray>) -> Unit, | ||
| gridSelectionType: GridSelectionType, | ||
| modifier: Modifier = Modifier, | ||
| unavailableGrid: List<BooleanArray>? = null, | ||
| onProposalSelected: (Pair<Int, Int>) -> Unit | ||
| ) { | ||
| var isRemoving by remember { mutableStateOf(false) } | ||
|
|
@@ -160,6 +161,9 @@ private fun SelectableGrid( | |
| * in. | ||
| */ | ||
|
|
||
| // Grey out cells not available to both parties, before the border/selection layers. | ||
| unavailableGrid?.let { drawUnavailableCells(it, rectWidth, rectHeight) } | ||
|
|
||
| // Draw border | ||
| drawBorder(grid, rectWidth, rectHeight) | ||
|
|
||
|
|
@@ -216,9 +220,18 @@ fun SelectableAvailabilityGrid( | |
| setSelectedAvailabilities: (List<LocalDateTime>) -> Unit, | ||
| gridSelectionType: GridSelectionType, | ||
| modifier: Modifier = Modifier, | ||
| /** | ||
| * When non-null, cells NOT in this list are greyed out — e.g. the intersection of two | ||
| * people's saved availability, so only times that work for both are shown as normal/white. | ||
| * Null means the greying feature isn't used for this grid. | ||
| */ | ||
| availableAvailabilities: List<LocalDateTime>? = null, | ||
| onProposalSelected: (LocalDateTime) -> Unit, | ||
| ) { | ||
| val grid = selectedAvailabilities.mapToGrid(dates) | ||
| val unavailableGrid = availableAvailabilities?.mapToGrid(dates)?.map { row -> | ||
| BooleanArray(row.size) { col -> !row[col] } | ||
| } | ||
|
Comment on lines
+232
to
+234
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Match availability by complete date.
Proposed fix- val column = dates.indexOfFirst { it.day == date.day }
+ val column = dates.indexOf(date.toLocalDate())🤖 Prompt for AI Agents |
||
|
|
||
| AvailabilityGridContainer(dates, modifier) { | ||
| SelectableGrid( | ||
|
|
@@ -228,6 +241,7 @@ fun SelectableAvailabilityGrid( | |
| setSelectedAvailabilities(newGrid.toAvailabilities(dates)) | ||
| }, | ||
| gridSelectionType = gridSelectionType, | ||
| unavailableGrid = unavailableGrid, | ||
| onProposalSelected = { | ||
| val (row, col) = it | ||
| onProposalSelected(rowColToLocalDateTime(row, col, dates)) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Block selection of unavailable cells.
These lines only render unavailable cells. The proposal pointer handler still calls
onProposalSelectedfor a grey cell. A user can enable Propose and submit a time outside the overlap. Before settingselectionStartProposal, reject a cell whoseunavailableGridvalue istrue.🤖 Prompt for AI Agents