Skip to content

Comments

Dataview Grid table#153

Open
uzairali19 wants to merge 34 commits intoposeidon/devfrom
520-component-table
Open

Dataview Grid table#153
uzairali19 wants to merge 34 commits intoposeidon/devfrom
520-component-table

Conversation

@uzairali19
Copy link
Contributor

@uzairali19 uzairali19 commented Aug 22, 2025

This pull request introduces a new "Audit Trail" page featuring a filterable, sortable, and paginated table for inspection traceability and accountability. It adds a reusable generic table state, integrates the new page into the sidebar and routing, and includes supporting style and dependency updates. Additionally, there is a temporary change to the authentication service that disables password verification.

Audit Trail Table Feature:

  • Added a new filter_table_demo.py page that displays an "Audit Trail" using the FilterTable component and the new GridState for managing table data, filters, sorting, and modal state. (mindtrace/apps/mindtrace/apps/poseidon/poseidon/pages/filter_table_demo.py, mindtrace/apps/mindtrace/apps/poseidon/poseidon/pages/filter_table_demo.pyR1-R15)
  • Implemented GridState, a reusable state class providing static table data, filter configuration, sorting, pagination, and modal logic for the audit trail table. (mindtrace/apps/mindtrace/apps/poseidon/poseidon/state/grid_state.py, mindtrace/apps/mindtrace/apps/poseidon/poseidon/state/grid_state.pyR1-R252)
  • Registered the new page in the app's routing and sidebar navigation, making it accessible via /filter-table-demo and adding an entry labeled "Audit Trail with Modal". (mindtrace/apps/mindtrace/apps/poseidon/poseidon/poseidon.py, [1] [2]; mindtrace/apps/mindtrace/apps/poseidon/poseidon/pages/__init__.py, [3] [4]; mindtrace/apps/mindtrace/apps/poseidon/poseidon/components_v2/layout/sidebar/sidebar.py, [5]

Supporting Updates:

Temporary Authentication Change:

@uzairali19 uzairali19 self-assigned this Aug 22, 2025
@uzairali19 uzairali19 changed the base branch from dev to poseidon/dev August 22, 2025 13:26
# Verify password against stored hash
if not verify_password(password, user.password_hash):
raise InvalidCredentialsError("Invalid password.")
# if not verify_password(password, user.password_hash):
Copy link
Contributor

Choose a reason for hiding this comment

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

let's remove this one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@canelbirlik
Copy link
Contributor

Thanks for the PR, I've left some comments on the individual parts and I'll test out the UI later, overall most immediate thing to do is hook it up with dataset and reflect the data models we have. That would guide the fields used in the UI side as well, right now we have unnecessary fields that are not in the db.
my suggestion on the strategy to integrate backend into this:

  • Repository to interact with DB.

  • Service calls repository with filters, scope queries by org_id, checks if user has acces to requested dynamic page.

  • View Models: We could fetch the data only needed to display the table columns or accordion view, then upon selection/modal open, we could fetch the detailed data, i.e.:
    row_vm: data needed to display the table -> summary projection of the original table data
    modal_vm : data needed to display the modal

  • Filterings are done on db calls (repo+service), UI displays the result as it is.

  • loading spinner : within the refresh calls, we set is_loading to true or false and table to display a spinner

@canelbirlik
Copy link
Contributor

also in case we want to render table in other pages, we might need table to have its own component state rather than a global one:
https://reflex.dev/docs/api-reference/componentstate/

@uzairali19 uzairali19 changed the base branch from poseidon/dev to poseidon/feature/line-insight-dashboard September 8, 2025 14:18
Copy link
Contributor

Choose a reason for hiding this comment

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

this file seems redundant, can we remove this and move this final page to filter_table.py ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would break the structure, since we are keeping pages separate from components. I think it's better to wrap page_container in the page file and have clarity in how we will use it, etc. Avoids confusion and is clear; we need to do that with other pages, too. I'll change the name and remove the demo.

page_size: int = DEFAULT_PAGE_SIZE

# Modal (row-level details)
modal_open: bool = False
Copy link
Contributor

@canelbirlik canelbirlik Sep 11, 2025

Choose a reason for hiding this comment

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

these many selected fields look crowded, same way we store a single rows, can we store a single details object?

also let's type rows and this, example:

@dataclass
class PartPreview:
... serial_ids, other preview info

@dataclass
class PartDetails:
images: List[str]
etc.

and then within the state:

self.rows:List[PartPreview]
self.selected_part_detail:PartDetail

this will be more safe, right now it's pretty hard to track what part details or what rows are

@uzairali19 uzairali19 changed the base branch from poseidon/feature/line-insight-dashboard to poseidon/dev September 18, 2025 20:05
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.

3 participants