Skip to content

feat(opgaver): multi-tavle filter on ListOpgaver + StreamOpgaveChanges#799

Merged
renemadsen merged 2 commits into
stablefrom
feat/opgaver-multi-tavle-filter
May 10, 2026
Merged

feat(opgaver): multi-tavle filter on ListOpgaver + StreamOpgaveChanges#799
renemadsen merged 2 commits into
stablefrom
feat/opgaver-multi-tavle-filter

Conversation

@renemadsen
Copy link
Copy Markdown
Member

Summary

  • Replaces string tavle_id = 2; with repeated string tavle_ids = 2; on ListOpgaverRequest and StreamOpgaveChangesRequest in opgaver.proto. Same field number, type change. Hard cutover — flutter is the only consumer.
  • C# handler OpgaverGrpcService.TryParseBoardIds(string) refactored to TryParseBoardIds(IEnumerable<string>) with per-entry skip-on-blank-or-non-numeric semantics + insertion-order-preserving HashSet dedup. Empty result still means "show all".
  • The two consumers (ListOpgaver line 202, StreamOpgaveChanges line 780) feed the parsed list into the existing CalendarTaskRequestModel.BoardIds which BackendConfigurationCalendarService.ShouldIncludeTask already filters on (1809-1813) — no business-logic changes, only proto + glue.
  • Auth gate untouched (property-level HasAccessAsync); EF schema untouched.

Why

Today the mobile home-page filter renders Checkbox widgets for tavler that visually read as multi-select, but the data model is single-select — checking a second board silently overwrites the first. This PR is the wire side of widening the model to Set<String> end-to-end. The flutter side is in a follow-up PR (linked below) that must merge in lockstep with this one (a flutter client carrying the new repeated field cannot talk to a tavle_id-only server, and vice versa).

Verification

  • Pre-commit dual-subagent gate (code-review + code-simplifier) clean. Reviewer recommended ship-it; simplifier dropped fully-qualified namespaces + tightened the XML doc.
  • dotnet clean && dotnet build against the embedded copy (/home/rene/Documents/workspace/microting/eform-angular-frontend/eFormAPI/Plugins/BackendConfiguration.Pn/): 0 errors, only pre-existing CS8632/NU1510 warnings.
  • Backend running locally on the new DLL.
  • The flutter-side feature PR will smoke-test end-to-end on device with a multi-tavler selection asserting only the chosen boards' opgaver render.

Known follow-ups (not in this PR)

  • No unit tests on TryParseBoardIds or the two RPCs. Worth a backlog item: table test covering null, [], [""], [" "], ["abc"], ["1","1","2"], ["1","abc","2"].

Lockstep

  • Merge order: this PR (toward stable) FIRST, then deploy the new backend, then merge the flutter-eform consumer PR.

🤖 Generated with Claude Code

renemadsen and others added 2 commits May 10, 2026 09:16
…iple tavle_ids

Replaces string tavle_id with repeated string tavle_ids on
ListOpgaverRequest and StreamOpgaveChangesRequest. The C# handlers
parse the repeated field directly into the existing BoardIds list
that BackendConfigurationCalendarService.ShouldIncludeTask already
filters on, so no business logic changes — only proto + glue.

Hard cutover (same field number, type change). The flutter consumer
is the only client of this proto; plugin and flutter PRs merge in
lockstep.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Simplifier polish on TryParseBoardIds: file already imports
System.Collections.Generic; bare List<int>/HashSet<int>/IEnumerable<string>
match the rest of OpgaverGrpcService. XML doc trimmed to the load-bearing
facts (per-entry skip semantics, dedup, empty=show-all contract).
Behavior unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 10, 2026 07:22
Copy link
Copy Markdown

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 updates the Opgaver gRPC contract and server adapter to support filtering tasks by multiple boards (“tavler”) by widening the request field from a single tavle_id to repeated tavle_ids, and plumbing that through to the existing CalendarTaskRequestModel.BoardIds filtering.

Changes:

  • Updated ListOpgaverRequest and StreamOpgaveChangesRequest in opgaver.proto to use repeated string tavle_ids = 2.
  • Updated OpgaverGrpcService to read request.TavleIds in both ListOpgaver and StreamOpgaveChanges.
  • Refactored TryParseBoardIds to accept IEnumerable<string>, skip blank/non-numeric entries per element, and deduplicate while preserving first-seen order.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/GrpcServices/OpgaverGrpcService.cs Switches request consumption to TavleIds and updates board-id parsing to handle multi-select input.
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Protos/opgaver.proto Updates gRPC request messages to accept multiple board IDs via repeated string tavle_ids.

Comment on lines +2934 to +2941
/// <summary>
/// Parse the repeated <c>tavle_ids</c> wire field into a deduplicated list
/// of numeric SDK board ids for <c>CalendarTaskRequestModel.BoardIds</c>.
/// Blank and non-numeric entries are skipped per-entry (not all-or-nothing);
/// an empty result means "no board filter, show all" downstream in
/// <c>BackendConfigurationCalendarService.ShouldIncludeTask</c>.
/// </summary>
private static List<int> TryParseBoardIds(IEnumerable<string> raws)
@renemadsen renemadsen merged commit 4482cab into stable May 10, 2026
21 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