Skip to content

feat: autosuggest for Link fields on data table records - #455

Closed
esafwan wants to merge 3 commits into
developfrom
feat/data-table-link-autosuggest
Closed

feat: autosuggest for Link fields on data table records#455
esafwan wants to merge 3 commits into
developfrom
feat/data-table-link-autosuggest

Conversation

@esafwan

@esafwan esafwan commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the bare text <Input> previously used for Link fieldtype columns with a proper LinkFieldInput component: async, debounced search against the target Huf Data Table's rows, results shown in a searchable dropdown (reusing the existing Combobox primitive already used in TriggerFieldsRenderer.tsx), selecting a row sets the actual link value.
  • Link targets are already restricted server-side to other Huf Data Tables only (pre-existing validation in validators.py) — no backend change needed for that part.
  • Extends the shared Combobox with two new optional, backward-compatible props (onSearchChange, shouldFilter) so other future async-search dropdowns can reuse it too.

Bugs found and fixed during live verification (not just static checks)

  • First implementation called get_table_schema(field.options), but field.options holds the target's doctype_name while get_table_schema expects the Huf Data Table registry record's own name — these are different identifiers and the call failed with "not found". Fixed by resolving the registry record directly via db.getDocList('Huf Data Table', { filters: [['doctype_name', '=', targetDoctype]] }).
  • Confirmed end-to-end on the live bench: typing in the dropdown returns matching rows, selecting one sets the link value correctly, shown in screenshots below.

Screenshots (live bench)

Autosuggest dropdown while typing:
autosuggest

After selecting a row:
selected

Test plan

  • yarn typecheck — 0 errors
  • yarn lint — 0 errors (60 pre-existing unrelated warnings)
  • Verified live on bench: created a temporary test table with a Link field to Customers, confirmed search-as-you-type and selection work end-to-end (test table removed after verification)

esafwan added 3 commits July 26, 2026 20:14
…cList call

Instead of calling getTableSchema which requires a registry record name, use direct db.getDocList query on 'Huf Data Table' to resolve the target doctype's schema (specifically title_field_name) using the doctype_name.
@esafwan

esafwan commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by consolidated Data Tables PR #460, now included in integration PR #468.

@esafwan esafwan closed this Jul 26, 2026
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.

1 participant